2014-11-01 20:55:25 +00:00
|
|
|
/* packet-dtn.c
|
2009-07-08 06:07:21 +00:00
|
|
|
* Copyright 2006-2007 The MITRE Corporation.
|
|
|
|
* All Rights Reserved.
|
|
|
|
* Approved for Public Release; Distribution Unlimited.
|
|
|
|
* Tracking Number 07-0090.
|
|
|
|
*
|
|
|
|
* The US Government will not be charged any license fee and/or royalties
|
|
|
|
* related to this software. Neither name of The MITRE Corporation; nor the
|
|
|
|
* names of its contributors may be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2010-02-18 06:32:23 +00:00
|
|
|
*
|
|
|
|
* Specification reference:
|
2013-08-15 09:09:49 +00:00
|
|
|
* RFC 5050
|
2020-04-13 11:06:37 +00:00
|
|
|
* https://tools.ietf.org/html/rfc5050
|
2009-07-08 06:07:21 +00:00
|
|
|
*/
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
/*
|
|
|
|
* Modifications were made to this file under designation MFS-33289-1 and
|
|
|
|
* are Copyright 2015 United States Government as represented by NASA
|
|
|
|
* Marshall Space Flight Center. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Released under the GNU GPL with NASA legal approval granted 2016-06-10.
|
|
|
|
*
|
|
|
|
* The subject software is provided "AS IS" WITHOUT ANY WARRANTY of any kind,
|
|
|
|
* either expressed, implied or statutory and this agreement does not,
|
|
|
|
* in any manner, constitute an endorsement by government agency of any
|
|
|
|
* results, designs or products resulting from use of the subject software.
|
|
|
|
* See the Agreement for the specific language governing permissions and
|
|
|
|
* limitations.
|
|
|
|
*/
|
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
#include <stdio.h>
|
2009-07-08 06:07:21 +00:00
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/reassemble.h>
|
2009-11-30 18:10:46 +00:00
|
|
|
#include <epan/expert.h>
|
2009-07-08 06:07:21 +00:00
|
|
|
#include "packet-dtn.h"
|
2013-08-13 11:37:27 +00:00
|
|
|
#include "packet-tcp.h"
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
static int dissect_admin_record(proto_tree *primary_tree, tvbuff_t *tvb, packet_info *pinfo,
|
|
|
|
int offset, int payload_length, gboolean* success);
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2019-08-21 11:48:56 +00:00
|
|
|
extern void
|
|
|
|
dissect_amp_as_subtree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset);
|
|
|
|
|
2021-02-14 15:36:32 +00:00
|
|
|
static int add_sdnv_time_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_sdnv_time);
|
2019-08-21 11:48:56 +00:00
|
|
|
|
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
/* For Reassembling TCP Convergence Layer segments */
|
2013-03-22 23:59:54 +00:00
|
|
|
static reassembly_table msg_reassembly_table;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
static const char magic[] = {'d', 't', 'n', '!'};
|
2009-07-08 06:07:21 +00:00
|
|
|
|
|
|
|
static int proto_bundle = -1;
|
|
|
|
static int proto_tcp_conv = -1;
|
|
|
|
static int hf_bundle_pdu_version = -1;
|
|
|
|
|
|
|
|
/* TCP Convergence Header Variables */
|
2013-08-13 11:37:27 +00:00
|
|
|
static int hf_tcp_convergence_pkt_type = -1;
|
|
|
|
|
2019-08-21 11:48:56 +00:00
|
|
|
/* Refuse-Bundle reason code */
|
|
|
|
static int hf_dtn_refuse_bundle_reason_code = -1;
|
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
static int hf_contact_hdr_version = -1;
|
|
|
|
static int hf_contact_hdr_flags = -1;
|
|
|
|
static int hf_contact_hdr_keep_alive = -1;
|
|
|
|
static int hf_contact_hdr_flags_ack_req = -1;
|
|
|
|
static int hf_contact_hdr_flags_frag_enable = -1;
|
|
|
|
static int hf_contact_hdr_flags_nak = -1;
|
2013-08-13 11:37:27 +00:00
|
|
|
static int hf_contact_hdr_magic = -1;
|
|
|
|
static int hf_contact_hdr_local_eid_length = -1;
|
|
|
|
static int hf_contact_hdr_local_eid = -1;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
|
|
|
/* TCP Convergence Data Header Variables */
|
|
|
|
static int hf_tcp_convergence_data_procflags = -1;
|
|
|
|
static int hf_tcp_convergence_data_procflags_start = -1;
|
|
|
|
static int hf_tcp_convergence_data_procflags_end = -1;
|
2013-08-13 11:37:27 +00:00
|
|
|
static int hf_tcp_convergence_data_segment_length = -1;
|
|
|
|
|
|
|
|
/* TCP Convergence Ack Variables */
|
|
|
|
static int hf_tcp_convergence_ack_length = -1;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
|
|
|
/* TCP Convergence Shutdown Header Variables */
|
|
|
|
static int hf_tcp_convergence_shutdown_flags = -1;
|
|
|
|
static int hf_tcp_convergence_shutdown_flags_reason = -1;
|
|
|
|
static int hf_tcp_convergence_shutdown_flags_delay = -1;
|
|
|
|
static int hf_tcp_convergence_shutdown_reason = -1;
|
|
|
|
static int hf_tcp_convergence_shutdown_delay = -1;
|
|
|
|
|
|
|
|
/*TCP Convergence Layer Reassembly boilerplate*/
|
|
|
|
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;
|
2011-01-30 21:01:07 +00:00
|
|
|
static int hf_msg_fragment_count = -1;
|
2009-07-08 06:07:21 +00:00
|
|
|
static int hf_msg_reassembled_in = -1;
|
2010-02-02 16:01:52 +00:00
|
|
|
static int hf_msg_reassembled_length = -1;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
|
|
|
/* Primary Header Processing Flag Variables */
|
|
|
|
static int hf_bundle_procflags = -1;
|
|
|
|
static int hf_bundle_procflags_fragment = -1;
|
|
|
|
static int hf_bundle_procflags_admin = -1;
|
|
|
|
static int hf_bundle_procflags_dont_fragment = -1;
|
|
|
|
static int hf_bundle_procflags_cust_xfer_req = -1;
|
|
|
|
static int hf_bundle_procflags_dest_singleton = -1;
|
|
|
|
static int hf_bundle_procflags_application_ack = -1;
|
|
|
|
|
|
|
|
/* Additions for Version 5 */
|
|
|
|
static int hf_bundle_control_flags = -1;
|
2013-08-13 11:37:27 +00:00
|
|
|
static int hf_bundle_procflags_general = -1;
|
|
|
|
static int hf_bundle_procflags_cos = -1;
|
|
|
|
static int hf_bundle_procflags_status = -1;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
|
|
|
/* Primary Header COS Flag Variables */
|
|
|
|
static int hf_bundle_cosflags = -1;
|
|
|
|
static int hf_bundle_cosflags_priority = -1;
|
|
|
|
|
|
|
|
/* Primary Header Status Report Request Flag Variables */
|
|
|
|
static int hf_bundle_srrflags = -1;
|
|
|
|
static int hf_bundle_srrflags_report_receipt = -1;
|
|
|
|
static int hf_bundle_srrflags_report_cust_accept = -1;
|
|
|
|
static int hf_bundle_srrflags_report_forward = -1;
|
|
|
|
static int hf_bundle_srrflags_report_delivery = -1;
|
|
|
|
static int hf_bundle_srrflags_report_deletion = -1;
|
|
|
|
static int hf_bundle_srrflags_report_ack = -1;
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
/* Primary Header Fields*/
|
2013-08-15 03:05:51 +00:00
|
|
|
static int hf_bundle_primary_header_len = -1;
|
|
|
|
static int hf_bundle_primary_dictionary_len = -1;
|
2013-08-13 11:37:27 +00:00
|
|
|
static int hf_bundle_primary_timestamp = -1;
|
2013-08-15 03:05:51 +00:00
|
|
|
static int hf_bundle_primary_fragment_offset = -1;
|
|
|
|
static int hf_bundle_primary_total_adu_len = -1;
|
|
|
|
static int hf_bundle_primary_timestamp_seq_num64 = -1;
|
|
|
|
static int hf_bundle_primary_timestamp_seq_num32 = -1;
|
|
|
|
|
|
|
|
static int hf_bundle_dest_scheme_offset_u16 = -1;
|
|
|
|
static int hf_bundle_dest_scheme_offset_i32 = -1;
|
|
|
|
static int hf_bundle_dest_ssp_offset_u16 = -1;
|
|
|
|
static int hf_bundle_dest_ssp_offset_i32 = -1;
|
|
|
|
static int hf_bundle_source_scheme_offset_u16 = -1;
|
|
|
|
static int hf_bundle_source_scheme_offset_i32 = -1;
|
|
|
|
static int hf_bundle_source_ssp_offset_u16 = -1;
|
|
|
|
static int hf_bundle_source_ssp_offset_i32 = -1;
|
|
|
|
static int hf_bundle_report_scheme_offset_u16 = -1;
|
|
|
|
static int hf_bundle_report_scheme_offset_i32 = -1;
|
|
|
|
static int hf_bundle_report_ssp_offset_u16 = -1;
|
|
|
|
static int hf_bundle_report_ssp_offset_i32 = -1;
|
|
|
|
static int hf_bundle_cust_scheme_offset_u16 = -1;
|
|
|
|
static int hf_bundle_cust_scheme_offset_i32 = -1;
|
|
|
|
static int hf_bundle_cust_ssp_offset_u16 = -1;
|
|
|
|
static int hf_bundle_cust_ssp_offset_i32 = -1;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
|
|
|
/* Dictionary EIDs */
|
|
|
|
static int hf_bundle_dest_scheme = -1;
|
|
|
|
static int hf_bundle_dest_ssp = -1;
|
|
|
|
static int hf_bundle_source_scheme = -1;
|
|
|
|
static int hf_bundle_source_ssp = -1;
|
|
|
|
static int hf_bundle_report_scheme = -1;
|
|
|
|
static int hf_bundle_report_ssp = -1;
|
|
|
|
static int hf_bundle_custodian_scheme = -1;
|
|
|
|
static int hf_bundle_custodian_ssp = -1;
|
|
|
|
|
|
|
|
/* Remaining Primary Header Fields */
|
|
|
|
static int hf_bundle_creation_timestamp = -1;
|
|
|
|
static int hf_bundle_lifetime = -1;
|
2013-08-15 03:05:51 +00:00
|
|
|
static int hf_bundle_lifetime_sdnv = -1;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
|
|
|
/* Secondary Header Processing Flag Variables */
|
2013-08-13 11:37:27 +00:00
|
|
|
static int hf_bundle_payload_length = -1;
|
2014-11-01 20:55:25 +00:00
|
|
|
static int hf_bundle_payload_header_type = -1;
|
2016-03-03 02:39:12 +00:00
|
|
|
static int hf_bundle_payload_data = -1;
|
2009-07-08 06:07:21 +00:00
|
|
|
static int hf_bundle_payload_flags = -1;
|
|
|
|
static int hf_bundle_payload_flags_replicate_hdr = -1;
|
|
|
|
static int hf_bundle_payload_flags_xmit_report = -1;
|
|
|
|
static int hf_bundle_payload_flags_discard_on_fail = -1;
|
|
|
|
static int hf_bundle_payload_flags_last_header = -1;
|
|
|
|
|
|
|
|
/* Block Processing Control Flag Variables (Version 5) */
|
|
|
|
static int hf_block_control_flags = -1;
|
2013-08-15 03:05:51 +00:00
|
|
|
static int hf_block_control_flags_sdnv = -1;
|
2009-07-08 06:07:21 +00:00
|
|
|
static int hf_block_control_replicate = -1;
|
|
|
|
static int hf_block_control_transmit_status = -1;
|
|
|
|
static int hf_block_control_delete_bundle = -1;
|
|
|
|
static int hf_block_control_last_block = -1;
|
|
|
|
static int hf_block_control_discard_block = -1;
|
|
|
|
static int hf_block_control_not_processed = -1;
|
|
|
|
static int hf_block_control_eid_reference = -1;
|
2013-08-15 03:05:51 +00:00
|
|
|
static int hf_block_control_block_length = -1;
|
|
|
|
static int hf_block_control_block_cteb_custody_id = -1;
|
|
|
|
static int hf_block_control_block_cteb_creator_custodian_eid = -1;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2012-05-08 14:17:16 +00:00
|
|
|
/* Non-Primary Block Type Code Variable */
|
|
|
|
static int hf_bundle_block_type_code = -1;
|
2016-03-03 02:39:12 +00:00
|
|
|
static int hf_bundle_unprocessed_block_data = -1;
|
2012-05-08 14:17:16 +00:00
|
|
|
|
2012-05-23 06:25:00 +00:00
|
|
|
/* ECOS Flag Variables */
|
|
|
|
static int hf_ecos_flags = -1;
|
|
|
|
static int hf_ecos_flags_critical = -1;
|
|
|
|
static int hf_ecos_flags_streaming = -1;
|
2016-03-03 02:39:12 +00:00
|
|
|
static int hf_ecos_flags_flowlabel = -1;
|
|
|
|
static int hf_ecos_flags_reliable = -1;
|
2013-08-15 03:05:51 +00:00
|
|
|
static int hf_ecos_flow_label = -1;
|
2012-05-23 06:25:00 +00:00
|
|
|
|
|
|
|
static int hf_ecos_ordinal = -1;
|
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
/* Administrative Record Variables */
|
2013-08-13 11:37:27 +00:00
|
|
|
static int hf_bundle_admin_record_type = -1;
|
|
|
|
static int hf_bundle_admin_record_fragment = -1;
|
2009-07-08 06:07:21 +00:00
|
|
|
static int hf_bundle_admin_statflags = -1;
|
|
|
|
static int hf_bundle_admin_rcvd = -1;
|
|
|
|
static int hf_bundle_admin_accepted = -1;
|
|
|
|
static int hf_bundle_admin_forwarded = -1;
|
|
|
|
static int hf_bundle_admin_delivered = -1;
|
|
|
|
static int hf_bundle_admin_deleted = -1;
|
|
|
|
static int hf_bundle_admin_acked = -1;
|
2013-08-13 11:37:27 +00:00
|
|
|
static int hf_bundle_admin_fragment_offset = -1;
|
|
|
|
static int hf_bundle_admin_fragment_length = -1;
|
|
|
|
static int hf_bundle_admin_timestamp_seq_num64 = -1;
|
|
|
|
static int hf_bundle_admin_timestamp_seq_num32 = -1;
|
2013-08-15 03:05:51 +00:00
|
|
|
static int hf_bundle_admin_endpoint_length = -1;
|
|
|
|
static int hf_bundle_admin_endpoint_id = -1;
|
2013-08-13 11:37:27 +00:00
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
static int hf_bundle_admin_receipt_time = -1;
|
|
|
|
static int hf_bundle_admin_accept_time = -1;
|
|
|
|
static int hf_bundle_admin_forward_time = -1;
|
|
|
|
static int hf_bundle_admin_delivery_time = -1;
|
|
|
|
static int hf_bundle_admin_delete_time = -1;
|
|
|
|
static int hf_bundle_admin_ack_time = -1;
|
|
|
|
static int hf_bundle_admin_timestamp_copy = -1;
|
|
|
|
static int hf_bundle_admin_signal_time = -1;
|
2012-05-02 12:47:59 +00:00
|
|
|
static int hf_bundle_status_report_reason_code = -1;
|
|
|
|
static int hf_bundle_custody_trf_succ_flg = -1;
|
|
|
|
static int hf_bundle_custody_signal_reason = -1;
|
2013-08-15 03:05:51 +00:00
|
|
|
static int hf_bundle_custody_id_range_start = -1;
|
|
|
|
static int hf_bundle_custody_id_range_end = -1;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2018-09-17 13:22:32 +00:00
|
|
|
static int hf_bundle_age_extension_block_code = -1;
|
|
|
|
static int hf_bundle_block_previous_hop_scheme = -1;
|
|
|
|
static int hf_bundle_block_previous_hop_eid = -1;
|
|
|
|
|
|
|
|
/* Security Block Variables */
|
|
|
|
static int hf_bundle_target_block_type = -1;
|
2018-10-12 06:07:20 +00:00
|
|
|
static int hf_bundle_target_block_occurrence = -1;
|
2018-09-17 13:22:32 +00:00
|
|
|
static int hf_bundle_ciphersuite_type = -1;
|
|
|
|
static int hf_bundle_ciphersuite_flags = -1;
|
|
|
|
static int hf_block_ciphersuite_params = -1;
|
|
|
|
static int hf_block_ciphersuite_params_length = -1;
|
|
|
|
static int hf_block_ciphersuite_params_item_length = -1;
|
|
|
|
static int hf_block_ciphersuite_param_type = -1;
|
|
|
|
static int hf_block_ciphersuite_param_data = -1;
|
|
|
|
static int hf_block_ciphersuite_result_length = -1;
|
|
|
|
static int hf_block_ciphersuite_result_item_length = -1;
|
|
|
|
static int hf_block_ciphersuite_result_type = -1;
|
|
|
|
static int hf_block_ciphersuite_result_data = -1;
|
|
|
|
static int hf_block_ciphersuite_range_offset = -1;
|
|
|
|
static int hf_block_ciphersuite_range_length = -1;
|
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
/* Tree Node Variables */
|
|
|
|
static gint ett_bundle = -1;
|
|
|
|
static gint ett_conv_flags = -1;
|
|
|
|
static gint ett_shutdown_flags = -1;
|
|
|
|
static gint ett_bundle_hdr = -1;
|
|
|
|
static gint ett_primary_hdr = -1;
|
|
|
|
static gint ett_proc_flags = -1;
|
|
|
|
static gint ett_gen_flags = -1;
|
|
|
|
static gint ett_cos_flags = -1;
|
|
|
|
static gint ett_srr_flags = -1;
|
|
|
|
static gint ett_dictionary = -1;
|
|
|
|
static gint ett_payload_hdr = -1;
|
|
|
|
static gint ett_payload_flags = -1;
|
|
|
|
static gint ett_block_flags = -1;
|
|
|
|
static gint ett_contact_hdr_flags = -1;
|
|
|
|
static gint ett_admin_record = -1;
|
|
|
|
static gint ett_admin_rec_status = -1;
|
|
|
|
static gint ett_metadata_hdr = -1;
|
2018-09-17 13:22:32 +00:00
|
|
|
static gint ett_sec_block_param_data = -1;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
static gint ett_tcp_conv = -1;
|
|
|
|
static gint ett_tcp_conv_hdr = -1;
|
|
|
|
static gint ett_msg_fragment = -1;
|
|
|
|
static gint ett_msg_fragments = -1;
|
|
|
|
|
|
|
|
static expert_field ei_bundle_payload_length = EI_INIT;
|
2013-05-25 17:06:40 +00:00
|
|
|
static expert_field ei_bundle_control_flags_length = EI_INIT;
|
2013-08-15 03:05:51 +00:00
|
|
|
static expert_field ei_bundle_block_control_flags = EI_INIT;
|
2013-08-13 11:37:27 +00:00
|
|
|
static expert_field ei_bundle_sdnv_length = EI_INIT;
|
|
|
|
static expert_field ei_bundle_timestamp_seq_num = EI_INIT;
|
2013-08-15 03:05:51 +00:00
|
|
|
static expert_field ei_bundle_offset_error = EI_INIT;
|
|
|
|
static expert_field ei_block_control_block_cteb_invalid = EI_INIT;
|
|
|
|
static expert_field ei_block_control_block_cteb_valid = EI_INIT;
|
2013-08-13 11:37:27 +00:00
|
|
|
|
|
|
|
static expert_field ei_tcp_convergence_data_flags = EI_INIT;
|
|
|
|
static expert_field ei_tcp_convergence_segment_length = EI_INIT;
|
|
|
|
static expert_field ei_tcp_convergence_ack_length = EI_INIT;
|
|
|
|
|
|
|
|
|
|
|
|
static dissector_handle_t bundle_handle;
|
2013-05-25 17:06:40 +00:00
|
|
|
|
2016-10-07 20:25:01 +00:00
|
|
|
#define BUNDLE_PORT 4556
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-08-15 03:05:51 +00:00
|
|
|
typedef struct dictionary_data {
|
|
|
|
int bundle_header_dict_length;
|
|
|
|
|
|
|
|
int dest_scheme_offset;
|
|
|
|
int dst_scheme_pos;
|
|
|
|
int dst_scheme_len;
|
|
|
|
int source_scheme_offset;
|
|
|
|
int src_scheme_pos;
|
|
|
|
int src_scheme_len;
|
|
|
|
int report_scheme_offset;
|
|
|
|
int rpt_scheme_pos;
|
|
|
|
int rpt_scheme_len;
|
|
|
|
int cust_scheme_offset;
|
|
|
|
int cust_scheme_pos;
|
|
|
|
int cust_scheme_len;
|
|
|
|
int dest_ssp_offset;
|
|
|
|
int dst_ssp_len;
|
|
|
|
int source_ssp_offset;
|
|
|
|
int src_ssp_len;
|
|
|
|
int report_ssp_offset;
|
|
|
|
int rpt_ssp_len;
|
|
|
|
int cust_ssp_offset;
|
|
|
|
int cust_ssp_len;
|
|
|
|
|
|
|
|
} dictionary_data_t;
|
|
|
|
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
static const value_string packet_type_vals[] = {
|
2013-11-16 02:46:04 +00:00
|
|
|
{((TCP_CONVERGENCE_DATA_SEGMENT>>4) & 0x0F), "Data"},
|
|
|
|
{((TCP_CONVERGENCE_ACK_SEGMENT>>4) & 0x0F), "Ack"},
|
2013-08-13 11:37:27 +00:00
|
|
|
{((TCP_CONVERGENCE_REFUSE_BUNDLE>>4) & 0x0F), "Refuse Bundle"},
|
2013-11-16 02:46:04 +00:00
|
|
|
{((TCP_CONVERGENCE_KEEP_ALIVE>>4) & 0x0F), "Keep Alive"},
|
|
|
|
{((TCP_CONVERGENCE_SHUTDOWN>>4) & 0x0F), "Shutdown"},
|
2019-08-21 11:48:56 +00:00
|
|
|
{((TCP_CONVERGENCE_LENGTH>>4) & 0x0F), "Length"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Refuse-Bundle Reason-Code Flags as per RFC-7242: Section-5.4 */
|
|
|
|
static const value_string refuse_bundle_reason_code[] = {
|
2020-04-01 21:54:43 +00:00
|
|
|
{TCP_REFUSE_BUNDLE_REASON_UNKNOWN, "Reason for refusal is unknown"},
|
|
|
|
{TCP_REFUSE_BUNDLE_REASON_RX_COMPLETE, "Complete Bundle Received"},
|
|
|
|
{TCP_REFUSE_BUNDLE_REASON_RX_EXHAUSTED, "Receiver's resources exhausted"},
|
|
|
|
{TCP_REFUSE_BUNDLE_REASON_RX_RETRANSMIT, "Receiver expects re-transmission of bundle"},
|
2013-08-13 11:37:27 +00:00
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string admin_record_type_vals[] = {
|
|
|
|
{ADMIN_REC_TYPE_STATUS_REPORT, "Bundle Status Report"},
|
|
|
|
{ADMIN_REC_TYPE_CUSTODY_SIGNAL, "Custody Signal"},
|
|
|
|
{ADMIN_REC_TYPE_AGGREGATE_CUSTODY_SIGNAL, "Aggregate Custody Signal"},
|
|
|
|
{ADMIN_REC_TYPE_ANNOUNCE_BUNDLE, "Announce Record (Contact)"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
static const value_string custody_signal_reason_codes[] = {
|
2012-05-08 14:17:16 +00:00
|
|
|
{0x0, "No Additional Information"},
|
2009-07-08 06:07:21 +00:00
|
|
|
{0x3, "Redundant Reception"},
|
|
|
|
{0x4, "Depleted Storage"},
|
|
|
|
{0x5, "Destination Endpoint ID Unintelligible"},
|
|
|
|
{0x6, "No Known Route to Destination"},
|
|
|
|
{0x7, "No Timely Contact with Next Node on Route"},
|
|
|
|
{0x8, "Header Unintelligible"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string status_report_reason_codes[] = {
|
2012-05-08 14:17:16 +00:00
|
|
|
{0x0, "No Additional Information"},
|
2009-07-08 06:07:21 +00:00
|
|
|
{0x1, "Lifetime Expired"},
|
|
|
|
{0x2, "Forwarded over Unidirectional Link"},
|
|
|
|
{0x3, "Transmission Cancelled"},
|
|
|
|
{0x4, "Depleted Storage"},
|
|
|
|
{0x5, "Destination Endpoint ID Unintelligible"},
|
|
|
|
{0x6, "No Known Route to Destination"},
|
|
|
|
{0x7, "No Timely Contact with Next Node on Route"},
|
|
|
|
{0x8, "Header Unintelligible"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
2012-05-08 14:17:16 +00:00
|
|
|
static const value_string bundle_block_type_codes[] = {
|
|
|
|
{0x01, "Bundle Payload Block"},
|
|
|
|
{0x02, "Bundle Authentication Block"},
|
2018-09-17 13:22:32 +00:00
|
|
|
{0x03, "Block Integrity Block"},
|
|
|
|
{0x04, "Block Confidentiality Block"},
|
2012-05-08 14:17:16 +00:00
|
|
|
{0x05, "Previous-Hop Insertion Block"},
|
|
|
|
{0x08, "Metadata Extension Block"},
|
|
|
|
{0x09, "Extension Security Block"},
|
|
|
|
{0x0a, "Custody Transfer Enhancement Block"},
|
|
|
|
{0x13, "Extended Class of Service Block"},
|
2017-09-11 13:43:17 +00:00
|
|
|
{0x14, "Bundle Age Extension Block"},
|
2012-05-08 14:17:16 +00:00
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
2013-08-15 03:05:51 +00:00
|
|
|
static const value_string cosflags_priority_vals[] = {
|
|
|
|
{0x00, "Bulk"},
|
|
|
|
{0x01, "Normal"},
|
|
|
|
{0x02, "Expedited"},
|
|
|
|
{0x03, "Invalid (Reserved)"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
2018-09-17 13:22:32 +00:00
|
|
|
static const value_string ciphersuite_types[] = {
|
|
|
|
{0x01, "HMAC_SHA1"},
|
|
|
|
{0x05, "HMAC_SHA256"},
|
|
|
|
{0x06, "ARC4_AES128"},
|
|
|
|
{0xD1, "HMAC_SHA384"},
|
|
|
|
{0xD2, "ECDSA_SHA256"},
|
|
|
|
{0xD3, "ECDSA_SHA384"},
|
|
|
|
{0xD4, "SHA256_AES128"},
|
|
|
|
{0xD5, "SHA384_AES256"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string res_params_types[] = {
|
|
|
|
{0x01, "Initialization Vector"},
|
|
|
|
{0x03, "Key Information"},
|
|
|
|
{0x04, "Content Range"},
|
|
|
|
{0x05, "Integrity Signature"},
|
|
|
|
{0x07, "Salt"},
|
|
|
|
{0x08, "BCB Integrity Check Value"},
|
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
/*
|
|
|
|
* SDNV has a zero in high-order bit position of last byte. The high-order
|
|
|
|
* bit of all preceding bytes is set to one. This returns the numeric value
|
|
|
|
* in an integer and sets the value of the second argument to the number of
|
|
|
|
* bytes used to code the SDNV. A -1 is returned if the evaluation fails
|
|
|
|
* (value exceeds maximum for signed integer). 0 is an acceptable value.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define SDNV_MASK 0x7f
|
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
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,
|
2011-01-30 21:01:07 +00:00
|
|
|
&hf_msg_fragment_count,
|
2009-07-08 06:07:21 +00:00
|
|
|
/*Reassembled in field*/
|
|
|
|
&hf_msg_reassembled_in,
|
2010-02-02 16:01:52 +00:00
|
|
|
/*Reassembled length field*/
|
|
|
|
&hf_msg_reassembled_length,
|
2012-09-07 02:09:59 +00:00
|
|
|
/* Reassembled data field */
|
|
|
|
NULL,
|
2009-07-08 06:07:21 +00:00
|
|
|
/*Tag*/
|
|
|
|
"Message fragments"
|
|
|
|
};
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
/*
|
|
|
|
* Adds the result of 2 SDNVs to tree: First SDNV is seconds, next is nanoseconds.
|
|
|
|
* Returns bytes in both SDNVs or 0 if something goes wrong.
|
|
|
|
*/
|
|
|
|
static int
|
|
|
|
add_dtn_time_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_dtn_time)
|
2009-07-08 06:07:21 +00:00
|
|
|
{
|
2013-08-13 11:37:27 +00:00
|
|
|
nstime_t dtn_time;
|
2013-11-16 02:46:04 +00:00
|
|
|
int sdnv_length, sdnv2_length;
|
|
|
|
int sdnv_value;
|
2016-03-03 02:39:12 +00:00
|
|
|
int orig_offset;
|
|
|
|
|
|
|
|
orig_offset = offset;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_value = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_value < 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return 0;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
dtn_time.secs = (time_t)(sdnv_value + 946684800);
|
|
|
|
offset += sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
dtn_time.nsecs = evaluate_sdnv(tvb, offset, &sdnv2_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (dtn_time.nsecs < 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return 0;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_tree_add_time(tree, hf_dtn_time, tvb, orig_offset, sdnv_length + sdnv2_length, &dtn_time);
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
return (sdnv_length + sdnv2_length);
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2013-08-13 11:37:27 +00:00
|
|
|
* Adds the result of SDNV which is a time since 2000 to tree.
|
|
|
|
* Returns bytes in SDNV or 0 if something goes wrong.
|
2009-07-08 06:07:21 +00:00
|
|
|
*/
|
2019-08-21 11:48:56 +00:00
|
|
|
int
|
2013-08-13 11:37:27 +00:00
|
|
|
add_sdnv_time_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_sdnv_time)
|
2009-07-08 06:07:21 +00:00
|
|
|
{
|
2013-08-13 11:37:27 +00:00
|
|
|
nstime_t dtn_time;
|
2013-11-16 02:46:04 +00:00
|
|
|
int sdnv_length;
|
|
|
|
int sdnv_value;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_value = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_value < 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return 0;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
dtn_time.secs = (time_t)(sdnv_value + 946684800);
|
|
|
|
dtn_time.nsecs = 0;
|
|
|
|
proto_tree_add_time(tree, hf_sdnv_time, tvb, offset, sdnv_length, &dtn_time);
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
return sdnv_length;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
|
|
|
|
2009-09-17 01:49:55 +00:00
|
|
|
static int
|
2013-08-13 11:37:27 +00:00
|
|
|
add_sdnv_to_tree(proto_tree *tree, tvbuff_t *tvb, packet_info* pinfo, int offset, int hf_sdnv)
|
2009-07-08 06:07:21 +00:00
|
|
|
{
|
2013-11-16 02:46:04 +00:00
|
|
|
proto_item *ti;
|
|
|
|
int sdnv_length;
|
|
|
|
int sdnv_value;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_value = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
ti = proto_tree_add_int(tree, hf_sdnv, tvb, offset, sdnv_length, sdnv_value);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_value < 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
expert_add_info(pinfo, ti, &ei_bundle_sdnv_length);
|
2011-04-03 15:39:01 +00:00
|
|
|
return 0;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
2013-08-13 11:37:27 +00:00
|
|
|
return sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
|
|
|
|
2013-08-15 03:05:51 +00:00
|
|
|
/*
|
|
|
|
* Pull out stuff from the dictionary
|
|
|
|
*/
|
2011-04-03 15:39:01 +00:00
|
|
|
static int
|
2013-08-15 03:05:51 +00:00
|
|
|
dissect_dictionary(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, dictionary_data_t* dict_data,
|
2016-03-03 02:39:12 +00:00
|
|
|
guint8 pri_hdr_procflags, gchar **bundle_custodian, int creation_timestamp, int timestamp_sequence)
|
2011-04-03 15:39:01 +00:00
|
|
|
{
|
2013-11-16 02:46:04 +00:00
|
|
|
proto_tree *dict_tree;
|
2016-03-03 02:39:12 +00:00
|
|
|
const gchar* col_text;
|
|
|
|
|
|
|
|
col_text = col_get_text(pinfo->cinfo, COL_INFO);
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2014-06-25 03:24:14 +00:00
|
|
|
dict_tree = proto_tree_add_subtree(tree, tvb, offset, dict_data->bundle_header_dict_length, ett_dictionary, NULL, "Dictionary");
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
/*
|
2012-05-08 14:17:16 +00:00
|
|
|
* If the dictionary length is 0, then the CBHE block compression method is applied. (RFC6260)
|
From Mithun Roy:
The primary header in bundle protocol contains some offset values(destination
scheme offset, destination ssp offset, source scheme offset, source ssp offset,
etc). These are the offsets within the dictionary if the length of the
dictionary length is greater than 0. But if the dictionary length is 0, then
these offset refer to node number and service number respectively(according to
compressed bundle header encoding). For example if destination scheme offset is
2 and the destination ssp offset is 1, then the destination
EID(<node_number>.<service_number>) is 2.1.
Currently the dtn dissector will consider these offsets to be actual offsets in
the dictionary even if the dictionary length is 0. So the values for the
EID's(destination, source, report, custodian) and their schemes are junk
values. For example if the destination scheme offset is 2 and the destination
ssp offset is 1 and the dictionary length is 0(which means the dictionary is
empty), then the destination scheme is 2 bytes after the beginning of the
metadata block(field after dictionary) and destination is 1 byte after the
beginning of the metadata block.
svn path=/trunk/; revision=30682
2009-10-24 11:19:23 +00:00
|
|
|
* So the scheme offset is the node number and the ssp offset is the service number.
|
|
|
|
* If destination scheme offset is 2 and destination ssp offset is 1, then the EID is
|
|
|
|
* ipn:2.1
|
2009-07-08 06:07:21 +00:00
|
|
|
*/
|
2013-11-16 02:46:04 +00:00
|
|
|
if (dict_data->bundle_header_dict_length == 0)
|
From Mithun Roy:
The primary header in bundle protocol contains some offset values(destination
scheme offset, destination ssp offset, source scheme offset, source ssp offset,
etc). These are the offsets within the dictionary if the length of the
dictionary length is greater than 0. But if the dictionary length is 0, then
these offset refer to node number and service number respectively(according to
compressed bundle header encoding). For example if destination scheme offset is
2 and the destination ssp offset is 1, then the destination
EID(<node_number>.<service_number>) is 2.1.
Currently the dtn dissector will consider these offsets to be actual offsets in
the dictionary even if the dictionary length is 0. So the values for the
EID's(destination, source, report, custodian) and their schemes are junk
values. For example if the destination scheme offset is 2 and the destination
ssp offset is 1 and the dictionary length is 0(which means the dictionary is
empty), then the destination scheme is 2 bytes after the beginning of the
metadata block(field after dictionary) and destination is 1 byte after the
beginning of the metadata block.
svn path=/trunk/; revision=30682
2009-10-24 11:19:23 +00:00
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
const gchar *src_node, *dst_node;
|
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
/*
|
|
|
|
* Destination info
|
|
|
|
*/
|
2013-11-16 02:46:04 +00:00
|
|
|
if (dict_data->dest_scheme_offset == 0 && dict_data->dest_ssp_offset == 0)
|
2011-04-03 15:39:01 +00:00
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_dest_scheme, tvb, 0, 0, DTN_SCHEME_STR);
|
2014-11-01 20:55:25 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_dest_ssp, tvb, dict_data->dst_scheme_pos,
|
2016-03-03 02:39:12 +00:00
|
|
|
dict_data->dst_scheme_len + dict_data->dst_ssp_len, "none");
|
|
|
|
|
|
|
|
dst_node = "dtn:none";
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_dest_scheme, tvb, 0, 0, IPN_SCHEME_STR);
|
2014-11-01 20:55:25 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_dest_ssp, tvb, dict_data->dst_scheme_pos,
|
2013-08-15 03:05:51 +00:00
|
|
|
dict_data->dst_scheme_len + dict_data->dst_ssp_len,
|
2021-07-16 15:36:34 +00:00
|
|
|
wmem_strdup_printf(pinfo->pool, "%d.%d",dict_data->dest_scheme_offset,dict_data->dest_ssp_offset));
|
2016-03-03 02:39:12 +00:00
|
|
|
|
2021-07-16 15:36:34 +00:00
|
|
|
dst_node = wmem_strdup_printf(pinfo->pool, "%s:%d.%d", IPN_SCHEME_STR,
|
2016-03-03 02:39:12 +00:00
|
|
|
dict_data->dest_scheme_offset, dict_data->dest_ssp_offset);
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Source info
|
|
|
|
*/
|
2013-11-16 02:46:04 +00:00
|
|
|
if (dict_data->source_scheme_offset == 0 && dict_data->source_ssp_offset == 0)
|
2011-04-03 15:39:01 +00:00
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_source_scheme, tvb, 0, 0, DTN_SCHEME_STR);
|
2014-11-01 20:55:25 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_source_ssp, tvb, dict_data->src_scheme_pos,
|
2016-03-03 02:39:12 +00:00
|
|
|
dict_data->src_scheme_len + dict_data->src_ssp_len, "none");
|
|
|
|
|
|
|
|
src_node = "dtn:none";
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_source_scheme, tvb, 0, 0, IPN_SCHEME_STR);
|
2014-11-01 20:55:25 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_source_ssp, tvb, dict_data->src_scheme_pos,
|
2013-08-15 03:05:51 +00:00
|
|
|
dict_data->src_scheme_len + dict_data->src_ssp_len,
|
2021-07-16 15:36:34 +00:00
|
|
|
wmem_strdup_printf(pinfo->pool, "%d.%d", dict_data->source_scheme_offset, dict_data->source_ssp_offset));
|
2016-03-03 02:39:12 +00:00
|
|
|
|
2021-07-16 15:36:34 +00:00
|
|
|
src_node = wmem_strdup_printf(pinfo->pool, "%s:%d.%d", IPN_SCHEME_STR,
|
2016-03-03 02:39:12 +00:00
|
|
|
dict_data->source_scheme_offset, dict_data->source_ssp_offset);
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Report to info
|
|
|
|
*/
|
2013-08-15 03:05:51 +00:00
|
|
|
if (dict_data->report_scheme_offset == 0 && dict_data->report_ssp_offset == 0)
|
2011-04-03 15:39:01 +00:00
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_report_scheme, tvb, 0, 0, DTN_SCHEME_STR);
|
2014-11-01 20:55:25 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_report_ssp, tvb, dict_data->rpt_scheme_pos,
|
2016-03-03 02:39:12 +00:00
|
|
|
dict_data->rpt_scheme_len + dict_data->rpt_ssp_len, "none");
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_report_scheme, tvb, 0, 0, IPN_SCHEME_STR);
|
2014-11-01 20:55:25 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_report_ssp, tvb, dict_data->rpt_scheme_pos,
|
2013-08-15 03:05:51 +00:00
|
|
|
dict_data->rpt_scheme_len + dict_data->rpt_ssp_len,
|
2021-07-16 15:36:34 +00:00
|
|
|
wmem_strdup_printf(pinfo->pool, "%d.%d", dict_data->report_scheme_offset, dict_data->report_ssp_offset));
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Custodian info
|
|
|
|
*/
|
2013-08-15 03:05:51 +00:00
|
|
|
if (dict_data->cust_scheme_offset == 0 && dict_data->cust_ssp_offset == 0)
|
2011-04-03 15:39:01 +00:00
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_custodian_scheme, tvb, 0, 0, DTN_SCHEME_STR);
|
2014-11-01 20:55:25 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_custodian_ssp, tvb, dict_data->cust_scheme_pos,
|
2016-03-03 02:39:12 +00:00
|
|
|
dict_data->cust_scheme_len + dict_data->cust_ssp_len, "none");
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_custodian_scheme, tvb, 0, 0, IPN_SCHEME_STR);
|
2014-11-01 20:55:25 +00:00
|
|
|
proto_tree_add_string(dict_tree, hf_bundle_custodian_ssp, tvb, dict_data->cust_scheme_pos,
|
2013-08-15 03:05:51 +00:00
|
|
|
dict_data->cust_scheme_len + dict_data->cust_ssp_len,
|
2021-07-16 15:36:34 +00:00
|
|
|
wmem_strdup_printf(pinfo->pool, "%d.%d", dict_data->cust_scheme_offset, dict_data->cust_ssp_offset));
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
/* remember custodian, for use in checking cteb validity */
|
2016-06-25 14:13:00 +00:00
|
|
|
col_set_writable(pinfo->cinfo, COL_INFO, TRUE);
|
2016-03-03 02:39:12 +00:00
|
|
|
col_clear_fence(pinfo->cinfo, COL_INFO);
|
|
|
|
if (col_text && strstr(col_text, " > ")) {
|
|
|
|
if (! strstr(col_text, "[multiple]")) {
|
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, ", [multiple]");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s > %s %d.%d", src_node, dst_node, creation_timestamp, timestamp_sequence);
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2016-03-03 02:39:12 +00:00
|
|
|
col_set_fence(pinfo->cinfo, COL_INFO);
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2021-07-16 15:36:34 +00:00
|
|
|
*bundle_custodian = wmem_strdup_printf(pinfo->pool, "%s:%d.%d", IPN_SCHEME_STR,
|
2013-09-14 10:53:29 +00:00
|
|
|
dict_data->cust_scheme_offset, dict_data->cust_ssp_offset);
|
From Mithun Roy:
The primary header in bundle protocol contains some offset values(destination
scheme offset, destination ssp offset, source scheme offset, source ssp offset,
etc). These are the offsets within the dictionary if the length of the
dictionary length is greater than 0. But if the dictionary length is 0, then
these offset refer to node number and service number respectively(according to
compressed bundle header encoding). For example if destination scheme offset is
2 and the destination ssp offset is 1, then the destination
EID(<node_number>.<service_number>) is 2.1.
Currently the dtn dissector will consider these offsets to be actual offsets in
the dictionary even if the dictionary length is 0. So the values for the
EID's(destination, source, report, custodian) and their schemes are junk
values. For example if the destination scheme offset is 2 and the destination
ssp offset is 1 and the dictionary length is 0(which means the dictionary is
empty), then the destination scheme is 2 bytes after the beginning of the
metadata block(field after dictionary) and destination is 1 byte after the
beginning of the metadata block.
svn path=/trunk/; revision=30682
2009-10-24 11:19:23 +00:00
|
|
|
}
|
2009-07-08 06:07:21 +00:00
|
|
|
|
|
|
|
/*
|
From Mithun Roy:
The primary header in bundle protocol contains some offset values(destination
scheme offset, destination ssp offset, source scheme offset, source ssp offset,
etc). These are the offsets within the dictionary if the length of the
dictionary length is greater than 0. But if the dictionary length is 0, then
these offset refer to node number and service number respectively(according to
compressed bundle header encoding). For example if destination scheme offset is
2 and the destination ssp offset is 1, then the destination
EID(<node_number>.<service_number>) is 2.1.
Currently the dtn dissector will consider these offsets to be actual offsets in
the dictionary even if the dictionary length is 0. So the values for the
EID's(destination, source, report, custodian) and their schemes are junk
values. For example if the destination scheme offset is 2 and the destination
ssp offset is 1 and the dictionary length is 0(which means the dictionary is
empty), then the destination scheme is 2 bytes after the beginning of the
metadata block(field after dictionary) and destination is 1 byte after the
beginning of the metadata block.
svn path=/trunk/; revision=30682
2009-10-24 11:19:23 +00:00
|
|
|
* This pointer can be made to address outside the packet boundaries so we
|
|
|
|
* need to check for improperly formatted strings (no null termination).
|
2009-07-08 06:07:21 +00:00
|
|
|
*/
|
2009-09-17 01:49:55 +00:00
|
|
|
|
From Mithun Roy:
The primary header in bundle protocol contains some offset values(destination
scheme offset, destination ssp offset, source scheme offset, source ssp offset,
etc). These are the offsets within the dictionary if the length of the
dictionary length is greater than 0. But if the dictionary length is 0, then
these offset refer to node number and service number respectively(according to
compressed bundle header encoding). For example if destination scheme offset is
2 and the destination ssp offset is 1, then the destination
EID(<node_number>.<service_number>) is 2.1.
Currently the dtn dissector will consider these offsets to be actual offsets in
the dictionary even if the dictionary length is 0. So the values for the
EID's(destination, source, report, custodian) and their schemes are junk
values. For example if the destination scheme offset is 2 and the destination
ssp offset is 1 and the dictionary length is 0(which means the dictionary is
empty), then the destination scheme is 2 bytes after the beginning of the
metadata block(field after dictionary) and destination is 1 byte after the
beginning of the metadata block.
svn path=/trunk/; revision=30682
2009-10-24 11:19:23 +00:00
|
|
|
else
|
|
|
|
{
|
2011-04-03 15:39:01 +00:00
|
|
|
/*
|
|
|
|
* Destination info
|
|
|
|
*/
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
proto_tree_add_item(dict_tree, hf_bundle_dest_scheme,
|
|
|
|
tvb, offset + dict_data->dest_scheme_offset, -1, ENC_ASCII|ENC_NA);
|
|
|
|
proto_tree_add_item(dict_tree, hf_bundle_dest_ssp,
|
|
|
|
tvb, offset + dict_data->dest_ssp_offset, -1, ENC_ASCII|ENC_NA);
|
2011-04-03 15:39:01 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Source info
|
|
|
|
*/
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
proto_tree_add_item(dict_tree, hf_bundle_source_scheme,
|
|
|
|
tvb, offset + dict_data->source_scheme_offset, -1, ENC_ASCII|ENC_NA);
|
|
|
|
proto_tree_add_item(dict_tree, hf_bundle_source_ssp,
|
|
|
|
tvb, offset + dict_data->source_ssp_offset, -1, ENC_ASCII|ENC_NA);
|
2011-04-03 15:39:01 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Report to info
|
|
|
|
*/
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
proto_tree_add_item(dict_tree, hf_bundle_report_scheme,
|
|
|
|
tvb, offset + dict_data->report_scheme_offset, -1, ENC_ASCII|ENC_NA);
|
|
|
|
proto_tree_add_item(dict_tree, hf_bundle_report_ssp,
|
|
|
|
tvb, offset + dict_data->report_ssp_offset, -1, ENC_ASCII|ENC_NA);
|
2011-04-03 15:39:01 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Custodian info
|
|
|
|
*/
|
|
|
|
|
2013-08-15 03:05:51 +00:00
|
|
|
proto_tree_add_item(dict_tree, hf_bundle_custodian_scheme, tvb, offset + dict_data->cust_scheme_offset, -1, ENC_ASCII|ENC_NA);
|
|
|
|
proto_tree_add_item(dict_tree, hf_bundle_custodian_ssp, tvb, offset + dict_data->cust_ssp_offset, -1, ENC_ASCII|ENC_NA);
|
2011-04-03 15:39:01 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Add Source/Destination to INFO Field
|
|
|
|
*/
|
|
|
|
|
2016-06-25 14:13:00 +00:00
|
|
|
col_set_writable(pinfo->cinfo, COL_INFO, TRUE);
|
2016-03-03 02:39:12 +00:00
|
|
|
col_clear_fence(pinfo->cinfo, COL_INFO);
|
|
|
|
if (col_text && strstr(col_text, " > "))
|
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, ", [multiple]");
|
|
|
|
else {
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s:%s > %s:%s %d.%d",
|
2021-07-16 15:36:34 +00:00
|
|
|
tvb_get_stringz_enc(pinfo->pool, tvb, offset + dict_data->source_scheme_offset, NULL, ENC_ASCII),
|
|
|
|
tvb_get_stringz_enc(pinfo->pool, tvb, offset + dict_data->source_ssp_offset, NULL, ENC_ASCII),
|
|
|
|
tvb_get_stringz_enc(pinfo->pool, tvb, offset + dict_data->dest_scheme_offset, NULL, ENC_ASCII),
|
|
|
|
tvb_get_stringz_enc(pinfo->pool, tvb, offset + dict_data->dest_ssp_offset, NULL, ENC_ASCII),
|
2016-03-03 02:39:12 +00:00
|
|
|
creation_timestamp, timestamp_sequence);
|
|
|
|
}
|
|
|
|
col_set_fence(pinfo->cinfo, COL_INFO);
|
|
|
|
|
2012-12-18 02:02:28 +00:00
|
|
|
|
2012-05-08 14:17:16 +00:00
|
|
|
/* remember custodian, for use in checking cteb validity */
|
2021-07-16 15:36:34 +00:00
|
|
|
*bundle_custodian = wmem_strdup_printf(pinfo->pool,
|
2013-11-16 02:46:04 +00:00
|
|
|
"%s:%s",
|
2021-07-16 15:36:34 +00:00
|
|
|
tvb_get_stringz_enc(pinfo->pool,
|
2013-11-16 02:46:04 +00:00
|
|
|
tvb, offset + dict_data->cust_scheme_offset,
|
2014-06-17 15:30:58 +00:00
|
|
|
NULL, ENC_ASCII),
|
2021-07-16 15:36:34 +00:00
|
|
|
tvb_get_stringz_enc(pinfo->pool,
|
2013-11-16 02:46:04 +00:00
|
|
|
tvb, offset + dict_data->cust_ssp_offset,
|
2014-06-17 15:30:58 +00:00
|
|
|
NULL, ENC_ASCII));
|
From Mithun Roy:
The primary header in bundle protocol contains some offset values(destination
scheme offset, destination ssp offset, source scheme offset, source ssp offset,
etc). These are the offsets within the dictionary if the length of the
dictionary length is greater than 0. But if the dictionary length is 0, then
these offset refer to node number and service number respectively(according to
compressed bundle header encoding). For example if destination scheme offset is
2 and the destination ssp offset is 1, then the destination
EID(<node_number>.<service_number>) is 2.1.
Currently the dtn dissector will consider these offsets to be actual offsets in
the dictionary even if the dictionary length is 0. So the values for the
EID's(destination, source, report, custodian) and their schemes are junk
values. For example if the destination scheme offset is 2 and the destination
ssp offset is 1 and the dictionary length is 0(which means the dictionary is
empty), then the destination scheme is 2 bytes after the beginning of the
metadata block(field after dictionary) and destination is 1 byte after the
beginning of the metadata block.
svn path=/trunk/; revision=30682
2009-10-24 11:19:23 +00:00
|
|
|
}
|
2013-08-15 03:05:51 +00:00
|
|
|
offset += dict_data->bundle_header_dict_length; /*Skip over dictionary*/
|
2012-05-08 14:17:16 +00:00
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
/*
|
|
|
|
* Do this only if Fragment Flag is set
|
|
|
|
*/
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
if (pri_hdr_procflags & BUNDLE_PROCFLAGS_FRAG_MASK) {
|
2016-03-03 02:39:12 +00:00
|
|
|
int sdnv_length;
|
2013-08-15 03:05:51 +00:00
|
|
|
sdnv_length = add_sdnv_to_tree(tree, tvb, pinfo, offset, hf_bundle_primary_fragment_offset);
|
|
|
|
if (sdnv_length < 0) {
|
2011-04-03 15:39:01 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
2013-08-15 03:05:51 +00:00
|
|
|
sdnv_length = add_sdnv_to_tree(tree, tvb, pinfo, offset, hf_bundle_primary_total_adu_len);
|
|
|
|
if (sdnv_length < 0) {
|
2011-04-03 15:39:01 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
offset += sdnv_length;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
2013-08-15 03:05:51 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This routine returns 0 if header decoding fails, otherwise the length of the primary
|
|
|
|
* header, starting right after version number.
|
|
|
|
*/
|
|
|
|
static int
|
2013-11-16 02:46:04 +00:00
|
|
|
dissect_version_4_primary_header(packet_info *pinfo, proto_tree *primary_tree, tvbuff_t *tvb,
|
|
|
|
guint8* pri_hdr_procflags, gchar **bundle_custodian)
|
2013-08-15 03:05:51 +00:00
|
|
|
{
|
2013-11-16 02:46:04 +00:00
|
|
|
int bundle_header_length;
|
|
|
|
int offset = 1; /* Version Number already displayed */
|
|
|
|
int sdnv_length;
|
2013-08-15 03:05:51 +00:00
|
|
|
dictionary_data_t dict_data;
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *srr_flag_tree, *proc_flag_tree, *cos_flag_tree;
|
2013-08-15 03:05:51 +00:00
|
|
|
|
|
|
|
/* Primary Header Processing Flags */
|
|
|
|
*pri_hdr_procflags = tvb_get_guint8(tvb, offset);
|
|
|
|
ti = proto_tree_add_item(primary_tree, hf_bundle_procflags, tvb,
|
|
|
|
offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proc_flag_tree = proto_item_add_subtree(ti, ett_proc_flags);
|
|
|
|
proto_tree_add_item(proc_flag_tree, hf_bundle_procflags_fragment,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(proc_flag_tree, hf_bundle_procflags_admin,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(proc_flag_tree, hf_bundle_procflags_dont_fragment,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(proc_flag_tree, hf_bundle_procflags_cust_xfer_req,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(proc_flag_tree, hf_bundle_procflags_dest_singleton,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
|
|
|
|
/* Primary Header COS Flags */
|
|
|
|
++offset;
|
|
|
|
ti = proto_tree_add_item(primary_tree, hf_bundle_cosflags, tvb,
|
|
|
|
offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
cos_flag_tree = proto_item_add_subtree(ti, ett_cos_flags);
|
|
|
|
proto_tree_add_item(cos_flag_tree, hf_bundle_cosflags_priority,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
/* Status Report Request Flags */
|
|
|
|
++offset;
|
|
|
|
ti = proto_tree_add_item(primary_tree, hf_bundle_srrflags, tvb,
|
|
|
|
offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
srr_flag_tree = proto_item_add_subtree(ti, ett_srr_flags);
|
|
|
|
|
|
|
|
proto_tree_add_item(srr_flag_tree, hf_bundle_srrflags_report_receipt,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(srr_flag_tree, hf_bundle_srrflags_report_cust_accept,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(srr_flag_tree, hf_bundle_srrflags_report_forward,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(srr_flag_tree, hf_bundle_srrflags_report_delivery,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(srr_flag_tree, hf_bundle_srrflags_report_deletion,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(srr_flag_tree, hf_bundle_srrflags_report_ack,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
++offset;
|
|
|
|
|
|
|
|
bundle_header_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
ti = proto_tree_add_int(primary_tree, hf_bundle_primary_header_len, tvb, offset, sdnv_length,
|
|
|
|
bundle_header_length);
|
|
|
|
if (bundle_header_length < 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "Bundle Header Length Error");
|
2013-08-15 03:05:51 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
|
|
|
/* Ensure all fields have been initialized */
|
|
|
|
memset(&dict_data, 0, sizeof(dict_data));
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Pick up offsets into dictionary (8 of them)
|
|
|
|
*/
|
|
|
|
|
|
|
|
dict_data.dest_scheme_offset = tvb_get_ntohs(tvb, offset);
|
|
|
|
dict_data.dst_scheme_pos = offset;
|
|
|
|
dict_data.dst_scheme_len = 2;
|
|
|
|
proto_tree_add_item(primary_tree, hf_bundle_dest_scheme_offset_u16,
|
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
dict_data.dest_ssp_offset = tvb_get_ntohs(tvb, offset);
|
|
|
|
dict_data.dst_ssp_len = 2;
|
|
|
|
proto_tree_add_item(primary_tree, hf_bundle_dest_ssp_offset_u16,
|
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
dict_data.source_scheme_offset = tvb_get_ntohs(tvb, offset);
|
|
|
|
dict_data.src_scheme_pos = offset;
|
|
|
|
dict_data.src_scheme_len = 2;
|
|
|
|
proto_tree_add_item(primary_tree, hf_bundle_source_scheme_offset_u16,
|
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
dict_data.source_ssp_offset = tvb_get_ntohs(tvb, offset);
|
|
|
|
dict_data.src_ssp_len = 2;
|
|
|
|
proto_tree_add_item(primary_tree, hf_bundle_source_ssp_offset_u16,
|
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
dict_data.report_scheme_offset = tvb_get_ntohs(tvb, offset);
|
|
|
|
dict_data.rpt_scheme_pos = offset;
|
|
|
|
dict_data.rpt_scheme_len = 2;
|
|
|
|
proto_tree_add_item(primary_tree, hf_bundle_report_scheme_offset_u16,
|
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
dict_data.report_ssp_offset = tvb_get_ntohs(tvb, offset);
|
|
|
|
dict_data.rpt_ssp_len = 2;
|
|
|
|
proto_tree_add_item(primary_tree, hf_bundle_report_ssp_offset_u16,
|
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
dict_data.cust_scheme_offset = tvb_get_ntohs(tvb, offset);
|
|
|
|
dict_data.cust_scheme_pos = offset;
|
|
|
|
dict_data.cust_scheme_len = 2;
|
|
|
|
proto_tree_add_item(primary_tree, hf_bundle_cust_scheme_offset_u16,
|
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
dict_data.cust_ssp_offset = tvb_get_ntohs(tvb, offset);
|
|
|
|
dict_data.cust_ssp_len = 2;
|
|
|
|
proto_tree_add_item(primary_tree, hf_bundle_cust_ssp_offset_u16,
|
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
proto_tree_add_item(primary_tree, hf_bundle_creation_timestamp,
|
|
|
|
tvb, offset, 8, ENC_BIG_ENDIAN);
|
|
|
|
offset += 8;
|
|
|
|
|
|
|
|
proto_tree_add_item(primary_tree, hf_bundle_lifetime, tvb, offset, 4, ENC_BIG_ENDIAN);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
dict_data.bundle_header_dict_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
ti = proto_tree_add_int(primary_tree, hf_bundle_primary_dictionary_len, tvb, offset, sdnv_length,
|
|
|
|
dict_data.bundle_header_dict_length);
|
|
|
|
if (dict_data.bundle_header_dict_length < 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "Dictionary Header Length Error");
|
2013-08-15 03:05:51 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
offset = dissect_dictionary(pinfo, primary_tree, tvb, offset, &dict_data, *pri_hdr_procflags, bundle_custodian, 0, 0);
|
2013-08-15 03:05:51 +00:00
|
|
|
return offset;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This routine returns 0 if header decoding fails, otherwise the length of the primary
|
2013-08-15 03:05:51 +00:00
|
|
|
* header, starting right after version number.
|
2009-07-08 06:07:21 +00:00
|
|
|
*/
|
|
|
|
|
2019-08-21 11:48:56 +00:00
|
|
|
static int src_ssp;
|
|
|
|
static int dst_ssp;
|
|
|
|
|
2009-09-17 01:49:55 +00:00
|
|
|
static int
|
2011-04-03 15:39:01 +00:00
|
|
|
dissect_version_5_and_6_primary_header(packet_info *pinfo,
|
2013-11-16 02:46:04 +00:00
|
|
|
proto_tree *primary_tree, tvbuff_t *tvb,
|
|
|
|
guint8* pri_hdr_procflags, gchar **bundle_custodian)
|
2009-07-08 06:07:21 +00:00
|
|
|
{
|
2013-11-16 02:46:04 +00:00
|
|
|
guint64 bundle_processing_control_flags;
|
|
|
|
guint8 cosflags;
|
|
|
|
int bundle_header_length;
|
|
|
|
int offset = 1; /* Version Number already displayed */
|
|
|
|
int sdnv_length;
|
|
|
|
dictionary_data_t dict_data;
|
|
|
|
int timestamp_sequence;
|
2016-03-03 02:39:12 +00:00
|
|
|
int creation_timestamp;
|
2013-11-16 02:46:04 +00:00
|
|
|
guint8 srrflags;
|
|
|
|
proto_item *ti;
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_item *ti_dst_scheme_offset, *ti_dst_ssp_offset;
|
|
|
|
proto_item *ti_src_scheme_offset, *ti_src_ssp_offset;
|
|
|
|
proto_item *ti_cust_scheme_offset, *ti_cust_ssp_offset;
|
|
|
|
proto_item *ti_rprt_scheme_offset, *ti_rprt_ssp_offset;
|
2013-11-16 02:46:04 +00:00
|
|
|
proto_tree *gen_flag_tree, *srr_flag_tree, *proc_flag_tree, *cos_flag_tree;
|
2020-06-19 01:14:46 +00:00
|
|
|
static int * const pri_flags[] = {
|
2016-06-15 03:17:25 +00:00
|
|
|
&hf_bundle_procflags_fragment,
|
|
|
|
&hf_bundle_procflags_admin,
|
|
|
|
&hf_bundle_procflags_dont_fragment,
|
|
|
|
&hf_bundle_procflags_cust_xfer_req,
|
|
|
|
&hf_bundle_procflags_dest_singleton,
|
|
|
|
&hf_bundle_procflags_application_ack,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2020-06-19 01:14:46 +00:00
|
|
|
static int * const srr_flags[] = {
|
2016-06-15 03:17:25 +00:00
|
|
|
&hf_bundle_srrflags_report_receipt,
|
|
|
|
&hf_bundle_srrflags_report_cust_accept,
|
|
|
|
&hf_bundle_srrflags_report_forward,
|
|
|
|
&hf_bundle_srrflags_report_delivery,
|
|
|
|
&hf_bundle_srrflags_report_deletion,
|
|
|
|
NULL
|
|
|
|
};
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2010-02-20 11:06:16 +00:00
|
|
|
bundle_processing_control_flags = evaluate_sdnv_64(tvb, offset, &sdnv_length);
|
2009-07-08 06:07:21 +00:00
|
|
|
|
|
|
|
/* Primary Header Processing Flags */
|
2013-08-13 11:37:27 +00:00
|
|
|
*pri_hdr_procflags = (guint8) (bundle_processing_control_flags & 0x7f);
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2011-11-21 17:49:27 +00:00
|
|
|
if (sdnv_length < 1 || sdnv_length > 8) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, primary_tree, &ei_bundle_control_flags_length,
|
2011-04-03 15:39:01 +00:00
|
|
|
"Wrong bundle control flag length: %d", sdnv_length);
|
|
|
|
return 0;
|
2009-11-30 18:10:46 +00:00
|
|
|
}
|
2013-08-15 03:05:51 +00:00
|
|
|
ti = proto_tree_add_item(primary_tree, hf_bundle_control_flags, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset, sdnv_length, ENC_BIG_ENDIAN);
|
2013-08-15 03:05:51 +00:00
|
|
|
proc_flag_tree = proto_item_add_subtree(ti, ett_proc_flags);
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-08-15 03:05:51 +00:00
|
|
|
ti = proto_tree_add_uint(proc_flag_tree, hf_bundle_procflags_general, tvb, offset,
|
|
|
|
sdnv_length, *pri_hdr_procflags);
|
|
|
|
gen_flag_tree = proto_item_add_subtree(ti, ett_gen_flags);
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2016-06-15 03:17:25 +00:00
|
|
|
/* With the variability of sdnv_length, proto_tree_add_bitmask_value
|
|
|
|
can't be used */
|
|
|
|
|
|
|
|
proto_tree_add_bitmask_list_value(gen_flag_tree, tvb, offset, sdnv_length, pri_flags, *pri_hdr_procflags);
|
2009-07-08 06:07:21 +00:00
|
|
|
|
|
|
|
/* Primary Header COS Flags */
|
|
|
|
cosflags = (guint8) ((bundle_processing_control_flags >> 7) & 0x7f);
|
2013-08-15 03:05:51 +00:00
|
|
|
ti = proto_tree_add_uint(proc_flag_tree, hf_bundle_procflags_cos, tvb, offset,
|
|
|
|
sdnv_length, cosflags);
|
|
|
|
cos_flag_tree = proto_item_add_subtree(ti, ett_cos_flags);
|
|
|
|
proto_tree_add_uint(cos_flag_tree, hf_bundle_cosflags_priority, tvb, offset,
|
|
|
|
sdnv_length, cosflags);
|
2009-07-08 06:07:21 +00:00
|
|
|
|
|
|
|
/* Status Report Request Flags */
|
|
|
|
srrflags = (guint8) ((bundle_processing_control_flags >> 14) & 0x7f);
|
2013-08-15 03:05:51 +00:00
|
|
|
ti = proto_tree_add_uint(proc_flag_tree, hf_bundle_procflags_status, tvb, offset,
|
|
|
|
sdnv_length, srrflags);
|
|
|
|
srr_flag_tree = proto_item_add_subtree(ti, ett_srr_flags);
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2016-06-15 03:17:25 +00:00
|
|
|
proto_tree_add_bitmask_list_value(srr_flag_tree, tvb, offset, sdnv_length, srr_flags, srrflags);
|
2009-07-08 06:07:21 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
/* -- hdr_length -- */
|
|
|
|
bundle_header_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
ti = proto_tree_add_int(primary_tree, hf_bundle_primary_header_len, tvb, offset, sdnv_length,
|
|
|
|
bundle_header_length);
|
|
|
|
if (bundle_header_length < 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "Bundle Header Length Error");
|
2011-04-03 15:39:01 +00:00
|
|
|
return 0;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
2013-08-15 03:05:51 +00:00
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Pick up offsets into dictionary (8 of them). Do rough sanity check that SDNV
|
|
|
|
* hasn't told us to access way past the Primary Header.
|
|
|
|
*/
|
|
|
|
|
2013-08-15 03:05:51 +00:00
|
|
|
/* Ensure all fields have been initialized */
|
|
|
|
memset(&dict_data, 0, sizeof(dict_data));
|
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
/* -- dest_scheme -- */
|
2013-08-15 03:05:51 +00:00
|
|
|
dict_data.dest_scheme_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
dict_data.dst_scheme_pos = offset;
|
|
|
|
dict_data.dst_scheme_len = sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
ti_dst_scheme_offset = proto_tree_add_int(primary_tree, hf_bundle_dest_scheme_offset_i32, tvb, offset, sdnv_length,
|
2013-11-16 02:46:04 +00:00
|
|
|
dict_data.dest_scheme_offset);
|
2009-07-08 06:07:21 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
/* -- dest_ssp -- */
|
2013-08-15 03:05:51 +00:00
|
|
|
dict_data.dest_ssp_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
dict_data.dst_ssp_len = sdnv_length;
|
2019-08-21 11:48:56 +00:00
|
|
|
dst_ssp = dict_data.dest_ssp_offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
ti_dst_ssp_offset = proto_tree_add_int(primary_tree, hf_bundle_dest_ssp_offset_i32, tvb, offset, sdnv_length,
|
2013-11-16 02:46:04 +00:00
|
|
|
dict_data.dest_ssp_offset);
|
2009-07-08 06:07:21 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
/* -- source_scheme -- */
|
2013-08-15 03:05:51 +00:00
|
|
|
dict_data.source_scheme_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
dict_data.src_scheme_pos = offset;
|
|
|
|
dict_data.src_scheme_len = sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
ti_src_scheme_offset = proto_tree_add_int(primary_tree, hf_bundle_source_scheme_offset_i32, tvb, offset, sdnv_length,
|
2013-11-16 02:46:04 +00:00
|
|
|
dict_data.source_scheme_offset);
|
2009-07-08 06:07:21 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
/* -- source_ssp -- */
|
2013-08-15 03:05:51 +00:00
|
|
|
dict_data.source_ssp_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
dict_data.src_ssp_len = sdnv_length;
|
2019-08-21 11:48:56 +00:00
|
|
|
src_ssp = dict_data.source_ssp_offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
ti_src_ssp_offset = proto_tree_add_int(primary_tree, hf_bundle_source_ssp_offset_i32, tvb, offset, sdnv_length,
|
2013-11-16 02:46:04 +00:00
|
|
|
dict_data.source_ssp_offset);
|
2009-07-08 06:07:21 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
/* -- report_scheme -- */
|
2013-08-15 03:05:51 +00:00
|
|
|
dict_data.report_scheme_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
dict_data.rpt_scheme_pos = offset;
|
|
|
|
dict_data.rpt_scheme_len = sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
ti_rprt_scheme_offset = proto_tree_add_int(primary_tree, hf_bundle_report_scheme_offset_i32, tvb, offset,
|
2013-11-16 02:46:04 +00:00
|
|
|
sdnv_length, dict_data.report_scheme_offset);
|
2009-07-08 06:07:21 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
/* -- report_ssp -- */
|
2013-08-15 03:05:51 +00:00
|
|
|
dict_data.report_ssp_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
dict_data.rpt_ssp_len = sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
ti_rprt_ssp_offset = proto_tree_add_int(primary_tree, hf_bundle_report_ssp_offset_i32, tvb, offset, sdnv_length,
|
2013-11-16 02:46:04 +00:00
|
|
|
dict_data.report_ssp_offset);
|
2009-07-08 06:07:21 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
|
|
|
|
/* -- cust_scheme -- */
|
2013-08-15 03:05:51 +00:00
|
|
|
dict_data.cust_scheme_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
dict_data.cust_scheme_pos = offset;
|
|
|
|
dict_data.cust_scheme_len = sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
ti_cust_scheme_offset = proto_tree_add_int(primary_tree, hf_bundle_cust_scheme_offset_i32, tvb, offset, sdnv_length,
|
2013-11-16 02:46:04 +00:00
|
|
|
dict_data.cust_scheme_offset);
|
2009-07-08 06:07:21 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
/* -- cust_ssp -- */
|
2013-08-15 03:05:51 +00:00
|
|
|
dict_data.cust_ssp_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
dict_data.cust_ssp_len = sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
ti_cust_ssp_offset = proto_tree_add_int(primary_tree, hf_bundle_cust_ssp_offset_i32, tvb, offset, sdnv_length,
|
2013-11-16 02:46:04 +00:00
|
|
|
dict_data.cust_ssp_offset);
|
2009-07-08 06:07:21 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
creation_timestamp = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_length = add_sdnv_time_to_tree(primary_tree, tvb, offset, hf_bundle_primary_timestamp);
|
|
|
|
if (sdnv_length == 0)
|
2011-04-03 15:39:01 +00:00
|
|
|
return 0;
|
2013-08-13 11:37:27 +00:00
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
/* -- timestamp_sequence -- */
|
2009-07-08 06:07:21 +00:00
|
|
|
timestamp_sequence = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (timestamp_sequence < 0) {
|
2013-08-15 03:05:51 +00:00
|
|
|
gint64 ts_seq = evaluate_sdnv_64(tvb, offset, &sdnv_length);
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2013-08-15 03:05:51 +00:00
|
|
|
ti = proto_tree_add_int64(primary_tree, hf_bundle_primary_timestamp_seq_num64,
|
|
|
|
tvb, offset, sdnv_length, ts_seq);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (ts_seq < 0) {
|
2013-08-15 03:05:51 +00:00
|
|
|
expert_add_info(pinfo, ti, &ei_bundle_timestamp_seq_num);
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
2009-09-17 01:49:55 +00:00
|
|
|
else {
|
2013-08-15 03:05:51 +00:00
|
|
|
proto_tree_add_int(primary_tree, hf_bundle_primary_timestamp_seq_num32,
|
|
|
|
tvb, offset, sdnv_length, timestamp_sequence);
|
2009-09-17 01:49:55 +00:00
|
|
|
}
|
2009-07-08 06:07:21 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
/* -- lifetime -- */
|
2013-08-15 03:05:51 +00:00
|
|
|
sdnv_length = add_sdnv_to_tree(primary_tree, tvb, pinfo, offset, hf_bundle_lifetime_sdnv);
|
2009-07-08 06:07:21 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
/* -- dict_length -- */
|
2013-08-15 03:05:51 +00:00
|
|
|
dict_data.bundle_header_dict_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
ti = proto_tree_add_int(primary_tree, hf_bundle_primary_dictionary_len, tvb, offset, sdnv_length,
|
|
|
|
dict_data.bundle_header_dict_length);
|
|
|
|
if (dict_data.bundle_header_dict_length < 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "Dictionary Header Length Error");
|
2011-04-03 15:39:01 +00:00
|
|
|
return 0;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
if ((dict_data.dest_scheme_offset < 0) ||
|
|
|
|
(dict_data.bundle_header_dict_length > 0 && (dict_data.dest_scheme_offset > bundle_header_length))) {
|
|
|
|
expert_add_info_format(pinfo, ti_dst_scheme_offset, &ei_bundle_offset_error, "Destination Scheme Offset Error");
|
|
|
|
}
|
|
|
|
if ((dict_data.dest_ssp_offset < 0) ||
|
|
|
|
(dict_data.bundle_header_dict_length > 0 && (dict_data.dest_ssp_offset > bundle_header_length))) {
|
|
|
|
expert_add_info_format(pinfo, ti_dst_ssp_offset, &ei_bundle_offset_error, "Destination SSP Offset Error");
|
|
|
|
}
|
|
|
|
if ((dict_data.source_scheme_offset < 0) ||
|
|
|
|
(dict_data.bundle_header_dict_length > 0 && (dict_data.source_scheme_offset > bundle_header_length))) {
|
|
|
|
expert_add_info_format(pinfo, ti_src_scheme_offset, &ei_bundle_offset_error, "Source Scheme Offset Error");
|
|
|
|
}
|
|
|
|
if ((dict_data.source_ssp_offset < 0) ||
|
|
|
|
(dict_data.bundle_header_dict_length > 0 && (dict_data.source_ssp_offset > bundle_header_length))) {
|
|
|
|
expert_add_info_format(pinfo, ti_src_ssp_offset, &ei_bundle_offset_error, "Source SSP Offset Error");
|
|
|
|
}
|
|
|
|
if ((dict_data.report_scheme_offset < 0) ||
|
|
|
|
(dict_data.bundle_header_dict_length > 0 && (dict_data.report_scheme_offset > bundle_header_length))) {
|
|
|
|
expert_add_info_format(pinfo, ti_rprt_scheme_offset, &ei_bundle_offset_error, "Report Scheme Offset Error");
|
|
|
|
}
|
|
|
|
if ((dict_data.report_ssp_offset < 0) ||
|
|
|
|
(dict_data.bundle_header_dict_length > 0 && (dict_data.report_ssp_offset > bundle_header_length))) {
|
|
|
|
expert_add_info_format(pinfo, ti_rprt_ssp_offset, &ei_bundle_offset_error, "Report SSP Offset Error");
|
|
|
|
}
|
|
|
|
if ((dict_data.cust_scheme_offset < 0) ||
|
|
|
|
(dict_data.bundle_header_dict_length > 0 && (dict_data.cust_scheme_offset > bundle_header_length))) {
|
|
|
|
expert_add_info_format(pinfo, ti_cust_scheme_offset, &ei_bundle_offset_error, "Custodian Scheme Offset Error");
|
|
|
|
}
|
|
|
|
if ((dict_data.cust_ssp_offset < 0) ||
|
|
|
|
(dict_data.bundle_header_dict_length > 0 && (dict_data.cust_ssp_offset > bundle_header_length))) {
|
|
|
|
expert_add_info_format(pinfo, ti_cust_ssp_offset, &ei_bundle_offset_error, "Custodian SSP Offset Error");
|
|
|
|
}
|
|
|
|
|
|
|
|
offset = dissect_dictionary(pinfo, primary_tree, tvb, offset, &dict_data, *pri_hdr_procflags, bundle_custodian,
|
|
|
|
creation_timestamp, timestamp_sequence);
|
2013-08-15 03:05:51 +00:00
|
|
|
return offset;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2013-08-15 03:05:51 +00:00
|
|
|
* offset is where the header starts.
|
|
|
|
* Return new offset, and set lastheader if failure.
|
2009-07-08 06:07:21 +00:00
|
|
|
*/
|
2009-09-17 01:49:55 +00:00
|
|
|
static int
|
2013-08-13 11:37:27 +00:00
|
|
|
dissect_payload_header(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, guint8 version,
|
|
|
|
guint8 pri_hdr_procflags, gboolean *lastheader)
|
2009-07-08 06:07:21 +00:00
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_item *payload_block, *payload_item, *ti;
|
|
|
|
proto_tree *payload_block_tree, *payload_tree;
|
2013-08-15 03:05:51 +00:00
|
|
|
int sdnv_length, payload_length;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
payload_block_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_payload_hdr, &payload_block, "Payload Block");
|
|
|
|
|
|
|
|
payload_tree = proto_tree_add_subtree(payload_block_tree, tvb, offset, -1, ett_payload_hdr, &payload_item, "Payload Header");
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2014-11-01 20:55:25 +00:00
|
|
|
proto_tree_add_uint(payload_tree, hf_bundle_payload_header_type, tvb, offset, 1, 1);
|
2009-07-08 06:07:21 +00:00
|
|
|
++offset;
|
|
|
|
|
|
|
|
/* Add tree for processing flags */
|
|
|
|
/* This is really a SDNV but there are only 7 bits defined so leave it this way*/
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
if (version == 4) {
|
2020-06-19 01:14:46 +00:00
|
|
|
static int * const flags[] = {
|
2015-02-13 17:05:26 +00:00
|
|
|
&hf_bundle_payload_flags_replicate_hdr,
|
|
|
|
&hf_bundle_payload_flags_xmit_report,
|
|
|
|
&hf_bundle_payload_flags_discard_on_fail,
|
|
|
|
&hf_bundle_payload_flags_last_header,
|
|
|
|
NULL
|
|
|
|
};
|
2011-04-03 15:39:01 +00:00
|
|
|
guint8 procflags;
|
|
|
|
|
|
|
|
procflags = tvb_get_guint8(tvb, offset);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (procflags & HEADER_PROCFLAGS_LAST_HEADER) {
|
2011-04-03 15:39:01 +00:00
|
|
|
*lastheader = TRUE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*lastheader = FALSE;
|
|
|
|
}
|
2015-02-13 17:05:26 +00:00
|
|
|
proto_tree_add_bitmask(payload_tree, tvb, offset, hf_bundle_payload_flags,
|
|
|
|
ett_payload_flags, flags, ENC_BIG_ENDIAN);
|
2011-04-03 15:39:01 +00:00
|
|
|
++offset;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
2011-04-03 15:39:01 +00:00
|
|
|
else { /*Bundle Protocol Version 5*/
|
|
|
|
int control_flags;
|
|
|
|
proto_item *block_flag_item;
|
|
|
|
proto_tree *block_flag_tree;
|
|
|
|
|
|
|
|
control_flags = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (control_flags & BLOCK_CONTROL_LAST_BLOCK) {
|
2011-04-03 15:39:01 +00:00
|
|
|
*lastheader = TRUE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*lastheader = FALSE;
|
|
|
|
}
|
|
|
|
block_flag_item = proto_tree_add_item(payload_tree, hf_block_control_flags, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset, sdnv_length, ENC_BIG_ENDIAN);
|
2011-04-03 15:39:01 +00:00
|
|
|
block_flag_tree = proto_item_add_subtree(block_flag_item, ett_block_flags);
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
proto_tree_add_item(block_flag_tree, hf_block_control_replicate,
|
|
|
|
tvb, offset, sdnv_length, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(block_flag_tree, hf_block_control_transmit_status,
|
|
|
|
tvb, offset, sdnv_length, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(block_flag_tree, hf_block_control_delete_bundle,
|
|
|
|
tvb, offset, sdnv_length, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(block_flag_tree, hf_block_control_last_block,
|
|
|
|
tvb, offset, sdnv_length, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(block_flag_tree, hf_block_control_discard_block,
|
|
|
|
tvb, offset, sdnv_length, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(block_flag_tree, hf_block_control_not_processed,
|
|
|
|
tvb, offset, sdnv_length, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(block_flag_tree, hf_block_control_eid_reference,
|
|
|
|
tvb, offset, sdnv_length, ENC_BIG_ENDIAN);
|
2011-04-03 15:39:01 +00:00
|
|
|
offset += sdnv_length;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
payload_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-08-13 11:37:27 +00:00
|
|
|
ti = proto_tree_add_int(payload_tree, hf_bundle_payload_length, tvb, offset, sdnv_length, payload_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (payload_length < 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
expert_add_info(pinfo, ti, &ei_bundle_payload_length);
|
|
|
|
/* Force quiting */
|
|
|
|
*lastheader = TRUE;
|
|
|
|
return offset;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
2013-08-13 11:37:27 +00:00
|
|
|
|
|
|
|
proto_item_set_len(payload_item, 2 + sdnv_length);
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_item_set_len(payload_block, 2 + sdnv_length + payload_length);
|
2009-07-08 06:07:21 +00:00
|
|
|
|
|
|
|
offset += sdnv_length;
|
2013-11-16 02:46:04 +00:00
|
|
|
if (pri_hdr_procflags & BUNDLE_PROCFLAGS_ADMIN_MASK) {
|
2013-08-13 11:37:27 +00:00
|
|
|
gboolean success = FALSE;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2011-04-03 15:39:01 +00:00
|
|
|
/*
|
|
|
|
* XXXX - Have not allowed for admin record spanning multiple segments!
|
|
|
|
*/
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
offset = dissect_admin_record(payload_block_tree, tvb, pinfo, offset, payload_length, &success);
|
2013-08-13 11:37:27 +00:00
|
|
|
if (!success) {
|
|
|
|
/* Force quiting */
|
|
|
|
*lastheader = TRUE;
|
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2016-03-03 02:39:12 +00:00
|
|
|
} else {
|
2019-08-21 11:48:56 +00:00
|
|
|
/* If Source SSP Offset is 64 and Destination SSP offset is 65, then
|
|
|
|
interpret the payload-data part as CFDP. */
|
|
|
|
if (src_ssp == 0x40 &&
|
|
|
|
dst_ssp == 0x41)
|
|
|
|
{
|
|
|
|
dissect_cfdp_as_subtree (tvb, pinfo, payload_block_tree, offset);
|
|
|
|
}
|
|
|
|
/* If Source SSP Offset is 5 and Destination SSP offset is 6, then
|
|
|
|
interpret the payload-data part as AMP. */
|
|
|
|
else if ((src_ssp == 0x5 && dst_ssp == 0x6) ||
|
|
|
|
(dst_ssp == 0x5 && src_ssp == 0x6))
|
|
|
|
{
|
|
|
|
dissect_amp_as_subtree (tvb, pinfo, payload_block_tree, offset);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
proto_tree_add_string(payload_block_tree, hf_bundle_payload_data, tvb, offset, payload_length,
|
2021-07-16 15:36:34 +00:00
|
|
|
wmem_strdup_printf(pinfo->pool, "<%d bytes>",payload_length));
|
2019-08-21 11:48:56 +00:00
|
|
|
}
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
offset += payload_length;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
2013-08-13 11:37:27 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
return offset;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2013-08-15 03:05:51 +00:00
|
|
|
* Return the offset after the Administrative Record or set success = FALSE if analysis fails.
|
2009-07-08 06:07:21 +00:00
|
|
|
*/
|
2009-09-17 01:49:55 +00:00
|
|
|
static int
|
2013-08-13 11:37:27 +00:00
|
|
|
dissect_admin_record(proto_tree *primary_tree, tvbuff_t *tvb, packet_info *pinfo,
|
|
|
|
int offset, int payload_length, gboolean* success)
|
2009-07-08 06:07:21 +00:00
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_item *admin_record_item;
|
2011-04-03 15:39:01 +00:00
|
|
|
proto_tree *admin_record_tree;
|
2011-09-11 19:54:11 +00:00
|
|
|
proto_item *timestamp_sequence_item;
|
2013-11-16 02:46:04 +00:00
|
|
|
guint8 record_type;
|
|
|
|
guint8 status;
|
|
|
|
int start_offset = offset;
|
|
|
|
int sdnv_length;
|
|
|
|
int timestamp_sequence;
|
|
|
|
int endpoint_length;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
*success = FALSE;
|
2014-06-25 03:24:14 +00:00
|
|
|
admin_record_tree = proto_tree_add_subtree(primary_tree, tvb, offset, -1,
|
|
|
|
ett_admin_record, &admin_record_item, "Administrative Record");
|
2009-07-08 06:07:21 +00:00
|
|
|
record_type = tvb_get_guint8(tvb, offset);
|
|
|
|
|
2014-12-13 17:52:20 +00:00
|
|
|
proto_tree_add_item(admin_record_tree, hf_bundle_admin_record_type, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
switch ((record_type >> 4) & 0xf)
|
2009-07-08 06:07:21 +00:00
|
|
|
{
|
|
|
|
case ADMIN_REC_TYPE_STATUS_REPORT:
|
2011-04-03 15:39:01 +00:00
|
|
|
{
|
|
|
|
proto_item *status_flag_item;
|
|
|
|
proto_tree *status_flag_tree;
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
proto_tree_add_item(admin_record_tree, hf_bundle_admin_record_fragment, tvb, offset, 1, ENC_NA);
|
2012-02-06 22:12:32 +00:00
|
|
|
++offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
|
|
|
/* Decode Bundle Status Report Flags */
|
|
|
|
status = tvb_get_guint8(tvb, offset);
|
|
|
|
status_flag_item = proto_tree_add_item(admin_record_tree,
|
2011-10-06 03:35:44 +00:00
|
|
|
hf_bundle_admin_statflags, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2011-04-03 15:39:01 +00:00
|
|
|
status_flag_tree = proto_item_add_subtree(status_flag_item,
|
|
|
|
ett_admin_rec_status);
|
2013-08-13 11:37:27 +00:00
|
|
|
proto_tree_add_item(status_flag_tree, hf_bundle_admin_rcvd,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(status_flag_tree, hf_bundle_admin_accepted,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(status_flag_tree, hf_bundle_admin_forwarded,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(status_flag_tree, hf_bundle_admin_delivered,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(status_flag_tree, hf_bundle_admin_deleted,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(status_flag_tree, hf_bundle_admin_acked,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
2012-02-06 22:12:32 +00:00
|
|
|
++offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2012-05-08 14:17:16 +00:00
|
|
|
proto_tree_add_item(admin_record_tree, hf_bundle_status_report_reason_code, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2012-02-06 22:12:32 +00:00
|
|
|
++offset;
|
2012-05-02 12:47:59 +00:00
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
if (record_type & ADMIN_REC_FLAGS_FRAGMENT) {
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_length = add_sdnv_to_tree(admin_record_tree, tvb, pinfo, offset, hf_bundle_admin_fragment_offset);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_length <= 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_length = add_sdnv_to_tree(admin_record_tree, tvb, pinfo, offset, hf_bundle_admin_fragment_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_length <= 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2013-11-16 02:46:04 +00:00
|
|
|
if (status & ADMIN_STATUS_FLAGS_RECEIVED) {
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_length = add_dtn_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_receipt_time);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_length <= 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2013-11-16 02:46:04 +00:00
|
|
|
if (status & ADMIN_STATUS_FLAGS_ACCEPTED) {
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_length = add_dtn_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_accept_time);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_length <= 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2013-11-16 02:46:04 +00:00
|
|
|
if (status & ADMIN_STATUS_FLAGS_FORWARDED) {
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_length = add_dtn_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_forward_time);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_length <= 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2013-11-16 02:46:04 +00:00
|
|
|
if (status & ADMIN_STATUS_FLAGS_DELIVERED) {
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_length = add_dtn_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_delivery_time);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_length <= 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2013-11-16 02:46:04 +00:00
|
|
|
if (status & ADMIN_STATUS_FLAGS_DELETED) {
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_length = add_dtn_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_delete_time);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_length <= 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2013-11-16 02:46:04 +00:00
|
|
|
if (status & ADMIN_STATUS_FLAGS_ACKNOWLEDGED) {
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_length = add_dtn_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_ack_time);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_length <= 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Get 2 SDNVs for Creation Timestamp */
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_length = add_sdnv_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_timestamp_copy);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_length <= 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2011-09-11 19:54:11 +00:00
|
|
|
|
|
|
|
timestamp_sequence = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (timestamp_sequence < 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
gint64 ts_seq = evaluate_sdnv_64(tvb, offset, &sdnv_length);
|
2011-09-11 19:54:11 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
timestamp_sequence_item = proto_tree_add_int64(admin_record_tree, hf_bundle_admin_timestamp_seq_num64,
|
|
|
|
tvb, offset, sdnv_length, ts_seq);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (ts_seq < 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
expert_add_info(pinfo, timestamp_sequence_item, &ei_bundle_timestamp_seq_num);
|
|
|
|
return offset;
|
2011-09-11 19:54:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2013-08-13 11:37:27 +00:00
|
|
|
proto_tree_add_int(admin_record_tree, hf_bundle_admin_timestamp_seq_num32,
|
|
|
|
tvb, offset, sdnv_length, timestamp_sequence);
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
|
|
|
endpoint_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (endpoint_length < 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2013-08-15 03:05:51 +00:00
|
|
|
proto_tree_add_int(admin_record_tree, hf_bundle_admin_endpoint_length, tvb, offset, sdnv_length, endpoint_length);
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Endpoint name may not be null terminated. This routine is supposed
|
|
|
|
* to add the null at the end of the string buffer.
|
|
|
|
*/
|
2013-08-15 03:05:51 +00:00
|
|
|
proto_tree_add_item(admin_record_tree, hf_bundle_admin_endpoint_id, tvb, offset, endpoint_length, ENC_NA|ENC_ASCII);
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += endpoint_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
break;
|
2012-05-02 12:47:59 +00:00
|
|
|
} /* case ADMIN_REC_TYPE_STATUS_REPORT */
|
2009-07-08 06:07:21 +00:00
|
|
|
case ADMIN_REC_TYPE_CUSTODY_SIGNAL:
|
2012-05-02 12:47:59 +00:00
|
|
|
{
|
2013-08-13 11:37:27 +00:00
|
|
|
proto_tree_add_item(admin_record_tree, hf_bundle_admin_record_fragment, tvb, offset, 1, ENC_NA);
|
2012-02-06 22:12:32 +00:00
|
|
|
++offset;
|
2012-05-02 12:47:59 +00:00
|
|
|
|
2012-05-08 14:17:16 +00:00
|
|
|
proto_tree_add_item(admin_record_tree, hf_bundle_custody_trf_succ_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(admin_record_tree, hf_bundle_custody_signal_reason, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2012-05-02 12:47:59 +00:00
|
|
|
++offset;
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
if (record_type & ADMIN_REC_FLAGS_FRAGMENT) {
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_length = add_sdnv_to_tree(admin_record_tree, tvb, pinfo, offset, hf_bundle_admin_fragment_offset);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_length <= 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_length = add_sdnv_to_tree(admin_record_tree, tvb, pinfo, offset, hf_bundle_admin_fragment_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_length <= 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Signal Time */
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_length = add_dtn_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_signal_time);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_length <= 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
|
|
|
/* Timestamp copy */
|
2013-08-13 11:37:27 +00:00
|
|
|
sdnv_length = add_sdnv_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_timestamp_copy);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (sdnv_length <= 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2011-09-11 19:54:11 +00:00
|
|
|
|
|
|
|
timestamp_sequence = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (timestamp_sequence < 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
gint64 ts_seq = evaluate_sdnv_64(tvb, offset, &sdnv_length);
|
2011-09-11 19:54:11 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
timestamp_sequence_item = proto_tree_add_int64(admin_record_tree, hf_bundle_admin_timestamp_seq_num64,
|
|
|
|
tvb, offset, sdnv_length, ts_seq);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (ts_seq < 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
expert_add_info(pinfo, timestamp_sequence_item, &ei_bundle_timestamp_seq_num);
|
|
|
|
return offset;
|
2011-09-11 19:54:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2013-08-13 11:37:27 +00:00
|
|
|
proto_tree_add_int(admin_record_tree, hf_bundle_admin_timestamp_seq_num32,
|
|
|
|
tvb, offset, sdnv_length, timestamp_sequence);
|
2011-04-03 15:39:01 +00:00
|
|
|
}
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2011-04-03 15:39:01 +00:00
|
|
|
|
|
|
|
endpoint_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (endpoint_length < 0) {
|
2011-04-03 15:39:01 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2013-08-15 03:05:51 +00:00
|
|
|
proto_tree_add_int(admin_record_tree, hf_bundle_admin_endpoint_length, tvb, offset, sdnv_length, endpoint_length);
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += sdnv_length;
|
2013-08-15 03:05:51 +00:00
|
|
|
proto_tree_add_item(admin_record_tree, hf_bundle_admin_endpoint_id, tvb, offset, endpoint_length, ENC_NA|ENC_ASCII);
|
2012-02-06 22:12:32 +00:00
|
|
|
offset += endpoint_length;
|
2013-08-13 11:37:27 +00:00
|
|
|
break;
|
2012-05-02 12:47:59 +00:00
|
|
|
} /* case ADMIN_REC_TYPE_CUSTODY_SIGNAL */
|
|
|
|
case ADMIN_REC_TYPE_AGGREGATE_CUSTODY_SIGNAL:
|
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_item *ti;
|
2012-05-02 12:47:59 +00:00
|
|
|
int payload_bytes_processed = 0;
|
|
|
|
int right_edge = -1;
|
2016-03-03 02:39:12 +00:00
|
|
|
int fill_start;
|
2012-05-02 12:47:59 +00:00
|
|
|
int fill_length = -1;
|
|
|
|
int sdnv_length_start = -1;
|
|
|
|
int sdnv_length_gap = -1;
|
|
|
|
int sdnv_length_length = -1;
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
proto_tree_add_item(admin_record_tree, hf_bundle_admin_record_fragment, tvb, offset, 1, ENC_NA);
|
2012-05-02 12:47:59 +00:00
|
|
|
++offset;
|
|
|
|
++payload_bytes_processed;
|
|
|
|
|
2012-05-08 14:17:16 +00:00
|
|
|
proto_tree_add_item(admin_record_tree, hf_bundle_custody_trf_succ_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(admin_record_tree, hf_bundle_custody_signal_reason, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2012-05-02 12:47:59 +00:00
|
|
|
++offset;
|
|
|
|
++payload_bytes_processed;
|
|
|
|
|
|
|
|
/* process the first fill */
|
|
|
|
fill_start = evaluate_sdnv(tvb, offset, &sdnv_length_start);
|
2013-08-15 03:05:51 +00:00
|
|
|
ti = proto_tree_add_int(admin_record_tree, hf_bundle_custody_id_range_start, tvb, offset, sdnv_length_start, fill_start);
|
2012-05-02 12:47:59 +00:00
|
|
|
if (fill_start < 0 || sdnv_length_start < 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "ACS: Unable to process CTEB Custody ID Range start SDNV");
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2012-05-02 12:47:59 +00:00
|
|
|
}
|
|
|
|
fill_length = evaluate_sdnv(tvb, offset + sdnv_length_start, &sdnv_length_length);
|
2013-08-15 03:05:51 +00:00
|
|
|
ti = proto_tree_add_int(admin_record_tree, hf_bundle_custody_id_range_end, tvb, offset,
|
|
|
|
sdnv_length_start + sdnv_length_length, fill_start + fill_length - 1);
|
2012-05-02 12:47:59 +00:00
|
|
|
if (fill_length < 0 || sdnv_length_length < 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "ACS: Unable to process CTEB Custody ID Range length SDNV");
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2012-05-02 12:47:59 +00:00
|
|
|
}
|
2013-08-15 03:05:51 +00:00
|
|
|
|
2012-05-02 12:47:59 +00:00
|
|
|
right_edge = fill_start + fill_length;
|
|
|
|
offset += sdnv_length_start + sdnv_length_length;
|
|
|
|
payload_bytes_processed += sdnv_length_start + sdnv_length_length;
|
|
|
|
|
|
|
|
/* now attempt to consume all the rest of the data in the
|
|
|
|
* payload as additional fills */
|
|
|
|
while (payload_bytes_processed < payload_length) {
|
2016-03-03 02:39:12 +00:00
|
|
|
int fill_gap;
|
2012-05-02 12:47:59 +00:00
|
|
|
fill_gap = evaluate_sdnv(tvb, offset, &sdnv_length_gap);
|
2013-08-15 03:05:51 +00:00
|
|
|
ti = proto_tree_add_int(admin_record_tree, hf_bundle_custody_id_range_start, tvb, offset, sdnv_length_gap, fill_gap);
|
2012-05-02 12:47:59 +00:00
|
|
|
if (fill_gap < 0 || sdnv_length_gap < 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "ACS: Unable to process CTEB Custody ID Range gap SDNV");
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2012-05-02 12:47:59 +00:00
|
|
|
}
|
|
|
|
fill_length = evaluate_sdnv(tvb, offset + sdnv_length_gap, &sdnv_length_length);
|
2013-08-15 03:05:51 +00:00
|
|
|
ti = proto_tree_add_int(admin_record_tree, hf_bundle_custody_id_range_end, tvb, offset,
|
|
|
|
sdnv_length_gap + sdnv_length_length, right_edge + fill_gap + fill_length - 1);
|
2012-05-02 12:47:59 +00:00
|
|
|
if (fill_length < 0 || sdnv_length_length < 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "ACS: Unable to process CTEB Custody ID Range length SDNV");
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2012-05-02 12:47:59 +00:00
|
|
|
}
|
2013-08-15 03:05:51 +00:00
|
|
|
|
2012-05-02 12:47:59 +00:00
|
|
|
right_edge += fill_gap + fill_length;
|
|
|
|
offset += sdnv_length_gap + sdnv_length_length;
|
|
|
|
payload_bytes_processed += sdnv_length_gap + sdnv_length_length;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (payload_bytes_processed > payload_length) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_bundle_offset_error, "ACS: CTEB Custody ID Range data extends past payload length");
|
2013-08-13 11:37:27 +00:00
|
|
|
return offset;
|
2012-05-02 12:47:59 +00:00
|
|
|
}
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
break;
|
2012-05-02 12:47:59 +00:00
|
|
|
} /* case ADMIN_REC_TYPE_AGGREGATE_CUSTODY_SIGNAL */
|
|
|
|
case ADMIN_REC_TYPE_ANNOUNCE_BUNDLE:
|
|
|
|
default:
|
2013-08-13 11:37:27 +00:00
|
|
|
offset++;
|
|
|
|
break;
|
2011-04-03 15:39:01 +00:00
|
|
|
} /* End Switch */
|
|
|
|
|
2013-08-13 13:28:14 +00:00
|
|
|
proto_item_set_len(admin_record_item, offset - start_offset);
|
2013-08-13 11:37:27 +00:00
|
|
|
*success = TRUE;
|
|
|
|
return offset;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
|
|
|
|
2009-09-17 01:49:55 +00:00
|
|
|
static int
|
2016-03-03 02:39:12 +00:00
|
|
|
display_extension_block(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, gchar *bundle_custodian, gboolean *lastheader)
|
2009-07-08 06:07:21 +00:00
|
|
|
{
|
2013-11-16 02:46:04 +00:00
|
|
|
proto_item *block_item, *ti, *block_flag_replicate_item, *block_flag_eid_reference_item;
|
|
|
|
proto_tree *block_tree;
|
|
|
|
int sdnv_length;
|
|
|
|
int block_length;
|
2016-03-03 02:39:12 +00:00
|
|
|
int block_overhead;
|
2017-09-11 13:43:17 +00:00
|
|
|
int bundle_age;
|
2013-11-16 02:46:04 +00:00
|
|
|
guint8 type;
|
|
|
|
unsigned int control_flags;
|
|
|
|
proto_tree *block_flag_tree;
|
|
|
|
proto_item *block_flag_item;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
|
|
|
type = tvb_get_guint8(tvb, offset);
|
2016-03-03 02:39:12 +00:00
|
|
|
block_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_metadata_hdr, &block_item, "Extension Block");
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
proto_tree_add_item(block_tree, hf_bundle_block_type_code, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-07-08 06:07:21 +00:00
|
|
|
++offset;
|
2016-03-03 02:39:12 +00:00
|
|
|
block_overhead = 1;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-08-15 03:05:51 +00:00
|
|
|
control_flags = (unsigned int)evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (control_flags & BLOCK_CONTROL_LAST_BLOCK) {
|
2011-04-03 15:39:01 +00:00
|
|
|
*lastheader = TRUE;
|
2011-08-10 15:52:52 +00:00
|
|
|
} else {
|
2011-04-03 15:39:01 +00:00
|
|
|
*lastheader = FALSE;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
2013-08-15 03:05:51 +00:00
|
|
|
block_flag_item = proto_tree_add_uint(block_tree, hf_block_control_flags_sdnv, tvb,
|
|
|
|
offset, sdnv_length, control_flags);
|
2012-05-08 14:17:16 +00:00
|
|
|
block_flag_tree = proto_item_add_subtree(block_flag_item, ett_block_flags);
|
2013-08-15 03:05:51 +00:00
|
|
|
block_flag_replicate_item = proto_tree_add_boolean(block_flag_tree, hf_block_control_replicate,
|
2013-08-13 11:37:27 +00:00
|
|
|
tvb, offset, sdnv_length, control_flags);
|
2011-08-10 15:52:52 +00:00
|
|
|
proto_tree_add_boolean(block_flag_tree, hf_block_control_transmit_status,
|
2013-08-13 11:37:27 +00:00
|
|
|
tvb, offset, sdnv_length, control_flags);
|
2011-08-10 15:52:52 +00:00
|
|
|
proto_tree_add_boolean(block_flag_tree, hf_block_control_delete_bundle,
|
2013-08-13 11:37:27 +00:00
|
|
|
tvb, offset, sdnv_length, control_flags);
|
2011-08-10 15:52:52 +00:00
|
|
|
proto_tree_add_boolean(block_flag_tree, hf_block_control_last_block,
|
2013-08-13 11:37:27 +00:00
|
|
|
tvb, offset, sdnv_length, control_flags);
|
2011-08-10 15:52:52 +00:00
|
|
|
proto_tree_add_boolean(block_flag_tree, hf_block_control_discard_block,
|
2013-08-13 11:37:27 +00:00
|
|
|
tvb, offset, sdnv_length, control_flags);
|
2011-08-10 15:52:52 +00:00
|
|
|
proto_tree_add_boolean(block_flag_tree, hf_block_control_not_processed,
|
2013-08-13 11:37:27 +00:00
|
|
|
tvb, offset, sdnv_length, control_flags);
|
2013-08-15 03:05:51 +00:00
|
|
|
block_flag_eid_reference_item = proto_tree_add_boolean(block_flag_tree, hf_block_control_eid_reference,
|
2013-08-13 11:37:27 +00:00
|
|
|
tvb, offset, sdnv_length, control_flags);
|
2012-05-08 14:17:16 +00:00
|
|
|
offset += sdnv_length;
|
2016-03-03 02:39:12 +00:00
|
|
|
block_overhead += sdnv_length;
|
2011-08-10 15:52:52 +00:00
|
|
|
|
2012-05-08 14:17:16 +00:00
|
|
|
/* TODO: if this block has EID references, add them to display tree */
|
2011-08-10 15:52:52 +00:00
|
|
|
if (control_flags & BLOCK_CONTROL_EID_REFERENCE) {
|
2013-11-16 02:46:04 +00:00
|
|
|
int i;
|
|
|
|
int num_eid_ref;
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
num_eid_ref = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2011-11-09 02:48:51 +00:00
|
|
|
offset += sdnv_length;
|
2016-03-03 02:39:12 +00:00
|
|
|
block_overhead += sdnv_length;
|
2011-08-10 15:52:52 +00:00
|
|
|
|
2011-11-09 02:48:51 +00:00
|
|
|
for (i = 0; i < num_eid_ref; i++)
|
|
|
|
{
|
2016-11-12 02:58:45 +00:00
|
|
|
if (evaluate_sdnv(tvb, offset, &sdnv_length) < 0)
|
|
|
|
break;
|
2011-11-09 02:48:51 +00:00
|
|
|
offset += sdnv_length;
|
2016-03-03 02:39:12 +00:00
|
|
|
block_overhead += sdnv_length;
|
2011-08-10 15:52:52 +00:00
|
|
|
|
2016-11-12 02:58:45 +00:00
|
|
|
if (evaluate_sdnv(tvb, offset, &sdnv_length) < 0)
|
|
|
|
break;
|
2011-11-09 02:48:51 +00:00
|
|
|
offset += sdnv_length;
|
2016-03-03 02:39:12 +00:00
|
|
|
block_overhead += sdnv_length;
|
2011-11-09 02:48:51 +00:00
|
|
|
}
|
2011-08-10 15:52:52 +00:00
|
|
|
}
|
2013-10-13 19:56:52 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
block_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-08-15 03:05:51 +00:00
|
|
|
ti = proto_tree_add_int(block_tree, hf_block_control_block_length, tvb, offset, sdnv_length, block_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (block_length < 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_bundle_offset_error, "Metadata Block Length Error");
|
2013-08-13 11:37:27 +00:00
|
|
|
/* Force quitting */
|
|
|
|
*lastheader = TRUE;
|
|
|
|
return offset;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
2012-05-08 14:17:16 +00:00
|
|
|
offset += sdnv_length;
|
2016-03-03 02:39:12 +00:00
|
|
|
block_overhead += sdnv_length;
|
|
|
|
|
2012-05-08 14:17:16 +00:00
|
|
|
/* now we have enough info to know total length of metadata block */
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_item_set_len(block_item, block_overhead + block_length);
|
2012-05-08 14:17:16 +00:00
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case BUNDLE_BLOCK_TYPE_AUTHENTICATION:
|
|
|
|
case BUNDLE_BLOCK_TYPE_METADATA_EXTENSION:
|
|
|
|
case BUNDLE_BLOCK_TYPE_EXTENSION_SECURITY:
|
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_tree_add_string(block_tree, hf_bundle_unprocessed_block_data, tvb, offset, block_length, "Block data");
|
2012-05-08 14:17:16 +00:00
|
|
|
/* not yet dissected, skip past data */
|
|
|
|
offset += block_length;
|
|
|
|
break;
|
|
|
|
}
|
2018-09-17 13:22:32 +00:00
|
|
|
case BUNDLE_BLOCK_TYPE_BUNDLE_AGE:
|
2017-09-11 13:43:17 +00:00
|
|
|
{
|
|
|
|
bundle_age = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
proto_tree_add_int(block_tree, hf_bundle_age_extension_block_code, tvb, offset, sdnv_length, bundle_age/1000000);
|
|
|
|
offset += block_length;
|
|
|
|
break;
|
|
|
|
}
|
2018-09-17 13:22:32 +00:00
|
|
|
case BUNDLE_BLOCK_TYPE_PREVIOUS_HOP_INSERT:
|
|
|
|
{
|
|
|
|
int scheme_length;
|
|
|
|
|
|
|
|
proto_tree_add_item_ret_length(block_tree, hf_bundle_block_previous_hop_scheme, tvb, offset, 4, ENC_ASCII, &scheme_length);
|
|
|
|
offset += scheme_length;
|
|
|
|
proto_tree_add_item(block_tree, hf_bundle_block_previous_hop_eid, tvb, offset, block_length-scheme_length, ENC_ASCII|ENC_NA);
|
|
|
|
offset += block_length - scheme_length;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case BUNDLE_BLOCK_TYPE_INTEGRITY:
|
|
|
|
case BUNDLE_BLOCK_TYPE_CONFIDENTIALITY:
|
|
|
|
{
|
|
|
|
int target_block_type;
|
2018-10-12 06:07:20 +00:00
|
|
|
int target_block_occurrence;
|
2018-09-17 13:22:32 +00:00
|
|
|
int ciphersuite_type;
|
|
|
|
unsigned int ciphersuite_flags;
|
|
|
|
|
|
|
|
target_block_type = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
proto_tree_add_int(block_tree, hf_bundle_target_block_type, tvb, offset, sdnv_length, target_block_type);
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
2018-10-12 06:07:20 +00:00
|
|
|
target_block_occurrence = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
proto_tree_add_int(block_tree, hf_bundle_target_block_occurrence, tvb, offset, sdnv_length, target_block_occurrence);
|
2018-09-17 13:22:32 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
|
|
|
ciphersuite_type = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
proto_tree_add_int(block_tree, hf_bundle_ciphersuite_type, tvb, offset, sdnv_length, ciphersuite_type);
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
|
|
|
ciphersuite_flags = (unsigned int)evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
block_flag_item = proto_tree_add_uint(block_tree, hf_bundle_ciphersuite_flags, tvb, offset, sdnv_length, ciphersuite_flags);
|
|
|
|
block_flag_tree = proto_item_add_subtree(block_flag_item, ett_block_flags);
|
|
|
|
proto_tree_add_boolean(block_flag_tree, hf_block_ciphersuite_params, tvb, offset, sdnv_length, ciphersuite_flags);
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
|
|
|
int range_offset;
|
|
|
|
int range_length;
|
|
|
|
if (ciphersuite_flags & BLOCK_CIPHERSUITE_PARAMS) {
|
|
|
|
/* Decode cipher suite parameters */
|
|
|
|
int params_length;
|
|
|
|
int param_type;
|
|
|
|
int item_length;
|
|
|
|
proto_tree *param_tree;
|
|
|
|
|
|
|
|
params_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
param_tree = proto_tree_add_subtree(block_tree, tvb, offset, params_length+1, ett_sec_block_param_data, NULL, "Ciphersuite Parameters Data");
|
|
|
|
proto_tree_add_int(param_tree, hf_block_ciphersuite_params_length, tvb, offset, sdnv_length, params_length);
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
|
|
|
for(int i = 0; i < params_length; i+=item_length+2)
|
|
|
|
{
|
|
|
|
param_type = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
proto_tree_add_int(param_tree, hf_block_ciphersuite_param_type, tvb, offset, sdnv_length, param_type);
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
|
|
|
item_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
proto_tree_add_int(param_tree, hf_block_ciphersuite_params_item_length, tvb, offset, sdnv_length, item_length);
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
|
|
|
//display item data
|
|
|
|
switch (param_type)
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
case 3:
|
|
|
|
case 5:
|
|
|
|
case 7:
|
|
|
|
case 8:
|
|
|
|
proto_tree_add_item(param_tree, hf_block_ciphersuite_param_data, tvb, offset, item_length, ENC_NA);
|
|
|
|
offset += item_length;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
//pair of sdnvs offset and length
|
|
|
|
range_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
proto_tree_add_int(param_tree, hf_block_ciphersuite_range_offset, tvb, offset, sdnv_length, range_offset);
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
|
|
|
range_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
proto_tree_add_int(param_tree, hf_block_ciphersuite_range_length, tvb, offset, sdnv_length, range_length);
|
|
|
|
offset += sdnv_length;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* Decode cipher suite results */
|
|
|
|
int result_length;
|
|
|
|
int result_type;
|
|
|
|
int result_item_length;
|
|
|
|
proto_tree *result_tree;
|
|
|
|
|
|
|
|
result_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
result_tree = proto_tree_add_subtree(block_tree, tvb, offset, result_length+1, ett_sec_block_param_data, NULL, "Security Results Data");
|
|
|
|
proto_tree_add_int(result_tree, hf_block_ciphersuite_result_length, tvb, offset, sdnv_length, result_length);
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
|
|
|
for(int i = 0; i < result_length; i+=result_item_length+2)
|
|
|
|
{
|
|
|
|
result_type = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
proto_tree_add_int(result_tree, hf_block_ciphersuite_result_type, tvb, offset, sdnv_length, result_type);
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
|
|
|
result_item_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
proto_tree_add_int(result_tree, hf_block_ciphersuite_result_item_length, tvb, offset, sdnv_length, result_item_length);
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
|
|
|
//display item data
|
|
|
|
switch (result_type)
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
case 3:
|
|
|
|
case 5:
|
|
|
|
case 7:
|
|
|
|
case 8:
|
|
|
|
proto_tree_add_item(result_tree, hf_block_ciphersuite_result_data, tvb, offset, result_item_length, ENC_NA);
|
|
|
|
offset += result_item_length;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
//pair of sdnvs offset and length
|
|
|
|
range_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
proto_tree_add_int(result_tree, hf_block_ciphersuite_range_offset, tvb, offset, sdnv_length, range_offset);
|
|
|
|
offset += sdnv_length;
|
|
|
|
|
|
|
|
range_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
proto_tree_add_int(result_tree, hf_block_ciphersuite_range_length, tvb, offset, sdnv_length, range_length);
|
|
|
|
offset += sdnv_length;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
2012-05-08 14:17:16 +00:00
|
|
|
case BUNDLE_BLOCK_TYPE_CUSTODY_TRANSFER:
|
|
|
|
{
|
2013-08-15 03:05:51 +00:00
|
|
|
int custody_id;
|
2016-06-26 14:52:37 +00:00
|
|
|
const guint8 *cteb_creator_custodian_eid;
|
2013-08-15 03:05:51 +00:00
|
|
|
int cteb_creator_custodian_eid_length;
|
2012-05-08 14:17:16 +00:00
|
|
|
|
2012-05-23 06:25:00 +00:00
|
|
|
/* check requirements for Block Processing Control Flags */
|
|
|
|
if ((control_flags & BLOCK_CONTROL_REPLICATE) != 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, block_flag_replicate_item, &ei_bundle_block_control_flags, "ERROR: Replicate must be clear for CTEB");
|
2012-05-23 06:25:00 +00:00
|
|
|
}
|
|
|
|
if ((control_flags & BLOCK_CONTROL_EID_REFERENCE) != 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, block_flag_eid_reference_item, &ei_bundle_block_control_flags, "ERROR: EID-Reference must be clear for CTEB");
|
2012-05-23 06:25:00 +00:00
|
|
|
}
|
|
|
|
|
2012-05-08 14:17:16 +00:00
|
|
|
/* there are two elements in a CTEB, first is the custody ID */
|
2013-08-13 11:37:27 +00:00
|
|
|
custody_id = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-08-15 03:05:51 +00:00
|
|
|
proto_tree_add_int(block_tree, hf_block_control_block_cteb_custody_id, tvb, offset, sdnv_length, custody_id);
|
2012-05-08 14:17:16 +00:00
|
|
|
offset += sdnv_length;
|
|
|
|
|
|
|
|
/* and second is the creator custodian EID */
|
|
|
|
cteb_creator_custodian_eid_length = block_length - sdnv_length;
|
2016-06-26 14:52:37 +00:00
|
|
|
ti = proto_tree_add_item_ret_string(block_tree, hf_block_control_block_cteb_creator_custodian_eid, tvb, offset,
|
2021-07-16 15:36:34 +00:00
|
|
|
cteb_creator_custodian_eid_length, ENC_ASCII, pinfo->pool, &cteb_creator_custodian_eid);
|
2013-08-15 03:05:51 +00:00
|
|
|
|
2012-05-08 14:17:16 +00:00
|
|
|
/* also check if CTEB is valid, i.e. custodians match */
|
2013-08-15 03:05:51 +00:00
|
|
|
if (bundle_custodian == NULL) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_block_control_block_cteb_invalid,
|
2012-05-08 14:17:16 +00:00
|
|
|
"CTEB Is NOT Valid (Bundle Custodian NULL)");
|
|
|
|
}
|
|
|
|
else if (strlen(cteb_creator_custodian_eid) != strlen(bundle_custodian)) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_block_control_block_cteb_invalid,
|
2012-05-08 14:17:16 +00:00
|
|
|
"CTEB Is NOT Valid (Bundle Custodian [%s] != CTEB Custodian [%s])",
|
|
|
|
bundle_custodian, cteb_creator_custodian_eid);
|
|
|
|
}
|
|
|
|
else if (memcmp(cteb_creator_custodian_eid, bundle_custodian, strlen(bundle_custodian)) != 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_block_control_block_cteb_invalid,
|
2012-05-08 14:17:16 +00:00
|
|
|
"CTEB Is NOT Valid (Bundle Custodian [%s] != CTEB Custodian [%s])",
|
|
|
|
bundle_custodian, cteb_creator_custodian_eid);
|
|
|
|
}
|
|
|
|
else {
|
2013-08-15 03:05:51 +00:00
|
|
|
expert_add_info(pinfo, ti, &ei_block_control_block_cteb_valid);
|
2012-05-08 14:17:16 +00:00
|
|
|
}
|
|
|
|
offset += cteb_creator_custodian_eid_length;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2012-05-23 06:25:00 +00:00
|
|
|
case BUNDLE_BLOCK_TYPE_EXTENDED_COS:
|
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
int flags;
|
2020-06-19 01:14:46 +00:00
|
|
|
static int * const ecos_flags_fields[] = {
|
2014-11-30 17:51:30 +00:00
|
|
|
&hf_ecos_flags_critical,
|
|
|
|
&hf_ecos_flags_streaming,
|
2016-03-03 02:39:12 +00:00
|
|
|
&hf_ecos_flags_flowlabel,
|
|
|
|
&hf_ecos_flags_reliable,
|
2014-11-30 17:51:30 +00:00
|
|
|
NULL
|
|
|
|
};
|
2012-05-23 06:25:00 +00:00
|
|
|
|
|
|
|
/* check requirements for Block Processing Control Flags */
|
|
|
|
if ((control_flags & BLOCK_CONTROL_REPLICATE) == 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, block_flag_replicate_item, &ei_bundle_block_control_flags, "ERROR: Replicate must be set for ECOS");
|
2012-05-23 06:25:00 +00:00
|
|
|
}
|
|
|
|
if ((control_flags & BLOCK_CONTROL_EID_REFERENCE) != 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, block_flag_eid_reference_item, &ei_bundle_block_control_flags, "ERROR: EID-Reference must be clear for ECOS");
|
2012-05-23 06:25:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* flags byte */
|
2013-08-13 11:37:27 +00:00
|
|
|
flags = (int)tvb_get_guint8(tvb, offset);
|
2014-11-30 17:51:30 +00:00
|
|
|
proto_tree_add_bitmask(block_tree, tvb, offset, hf_ecos_flags, ett_block_flags, ecos_flags_fields, ENC_BIG_ENDIAN);
|
2012-05-23 06:25:00 +00:00
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* ordinal byte */
|
2013-08-13 11:37:27 +00:00
|
|
|
proto_tree_add_item(block_tree, hf_ecos_ordinal, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2012-05-23 06:25:00 +00:00
|
|
|
offset += 1;
|
|
|
|
|
|
|
|
/* optional flow label sdnv */
|
2016-03-03 02:39:12 +00:00
|
|
|
if ((flags & ECOS_FLAGS_FLOWLABEL) != 0) {
|
|
|
|
int flow_label;
|
2013-08-13 11:37:27 +00:00
|
|
|
flow_label = evaluate_sdnv(tvb, offset, &sdnv_length);
|
2013-08-15 03:05:51 +00:00
|
|
|
ti = proto_tree_add_int(block_tree, hf_ecos_flow_label, tvb, offset, sdnv_length, flow_label);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (flow_label < 0) {
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "ECOS Flow Label Error");
|
2013-08-13 11:37:27 +00:00
|
|
|
/* Force quitting */
|
|
|
|
*lastheader = TRUE;
|
|
|
|
return offset;
|
2012-05-23 06:25:00 +00:00
|
|
|
}
|
|
|
|
offset += sdnv_length;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2012-05-08 14:17:16 +00:00
|
|
|
default:
|
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_tree_add_string(block_tree, hf_bundle_unprocessed_block_data, tvb, offset, block_length, "Block data");
|
2012-05-08 14:17:16 +00:00
|
|
|
/* unknown bundle type, skip past data */
|
|
|
|
offset += block_length;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2009-07-08 06:07:21 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
2011-04-03 15:39:01 +00:00
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
/*3rd arg is number of bytes in field (returned)*/
|
2009-11-29 19:11:55 +00:00
|
|
|
int
|
2009-09-17 01:49:55 +00:00
|
|
|
evaluate_sdnv(tvbuff_t *tvb, int offset, int *bytecount)
|
2009-07-08 06:07:21 +00:00
|
|
|
{
|
2013-11-16 02:46:04 +00:00
|
|
|
int value = 0;
|
2009-07-08 06:07:21 +00:00
|
|
|
guint8 curbyte;
|
|
|
|
|
|
|
|
*bytecount = 0;
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
if (!tvb_bytes_exist(tvb, offset, 1)) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
/*
|
|
|
|
* Get 1st byte and continue to get them while high-order bit is 1
|
|
|
|
*/
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
while ((curbyte = tvb_get_guint8(tvb, offset)) & ~SDNV_MASK) {
|
|
|
|
if (*bytecount >= (int) sizeof(int)) {
|
2011-04-03 15:39:01 +00:00
|
|
|
*bytecount = 0;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
value = value << 7;
|
|
|
|
value |= (curbyte & SDNV_MASK);
|
|
|
|
++offset;
|
|
|
|
++*bytecount;
|
2016-03-03 02:39:12 +00:00
|
|
|
|
|
|
|
if (!tvb_bytes_exist(tvb, offset, 1)) {
|
|
|
|
return -1;
|
|
|
|
}
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Add in the byte whose high-order bit is 0 (last one)
|
|
|
|
*/
|
|
|
|
|
|
|
|
value = value << 7;
|
|
|
|
value |= (curbyte & SDNV_MASK);
|
|
|
|
++*bytecount;
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
2009-09-17 01:49:55 +00:00
|
|
|
/* Special Function to evaluate 64 bit SDNVs */
|
2016-03-03 02:39:12 +00:00
|
|
|
/*3rd arg is number of bytes in field (returned)*/
|
2009-11-29 19:11:55 +00:00
|
|
|
gint64
|
2009-09-17 01:49:55 +00:00
|
|
|
evaluate_sdnv_64(tvbuff_t *tvb, int offset, int *bytecount)
|
|
|
|
{
|
|
|
|
gint64 value = 0;
|
|
|
|
guint8 curbyte;
|
|
|
|
|
|
|
|
*bytecount = 0;
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
if (!tvb_bytes_exist(tvb, offset, 1)) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2009-09-17 01:49:55 +00:00
|
|
|
/*
|
|
|
|
* Get 1st byte and continue to get them while high-order bit is 1
|
|
|
|
*/
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
while ((curbyte = tvb_get_guint8(tvb, offset)) & ~SDNV_MASK) {
|
|
|
|
if (*bytecount >= (int) sizeof(gint64)) {
|
2011-04-03 15:39:01 +00:00
|
|
|
*bytecount = 0;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
value = value << 7;
|
|
|
|
value |= (curbyte & SDNV_MASK);
|
|
|
|
++offset;
|
|
|
|
++*bytecount;
|
2016-03-03 02:39:12 +00:00
|
|
|
|
|
|
|
if (!tvb_bytes_exist(tvb, offset, 1)) {
|
|
|
|
return -1;
|
|
|
|
}
|
2009-09-17 01:49:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Add in the byte whose high-order bit is 0 (last one)
|
|
|
|
*/
|
|
|
|
|
|
|
|
value = value << 7;
|
|
|
|
value |= (curbyte & SDNV_MASK);
|
|
|
|
++*bytecount;
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
/* Special Function to evaluate 32 bit unsigned SDNVs with error indication
|
|
|
|
* bytecount returns the number bytes consumed
|
|
|
|
* value returns the actual value
|
|
|
|
*
|
|
|
|
* result is TRUE (1) on success else FALSE (0)
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
evaluate_sdnv32(tvbuff_t *tvb, int offset, int *bytecount, guint32 *value)
|
|
|
|
{
|
|
|
|
int result;
|
|
|
|
int num_bits_in_value;
|
|
|
|
guint8 curbyte;
|
|
|
|
guint8 high_bit;
|
|
|
|
|
|
|
|
*value = 0;
|
|
|
|
*bytecount = 0;
|
|
|
|
|
|
|
|
result = FALSE;
|
|
|
|
num_bits_in_value = 0;
|
|
|
|
|
|
|
|
if (tvb_bytes_exist(tvb, offset, 1)) {
|
|
|
|
/*
|
|
|
|
* Get 1st byte and continue to get them while high-order bit is 1
|
|
|
|
*/
|
|
|
|
result = TRUE;
|
|
|
|
|
|
|
|
/* Determine number of non-zero bits in first SDNV byte */
|
|
|
|
/* technically 0x80 0x80 ... 0x81 is a valid inefficient representation of "1" */
|
|
|
|
while ((0 == num_bits_in_value) && ((curbyte = tvb_get_guint8(tvb, offset)) & ~SDNV_MASK)) {
|
|
|
|
if (!tvb_bytes_exist(tvb, offset, 1)) {
|
|
|
|
result = FALSE;
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
num_bits_in_value = 7;
|
|
|
|
high_bit = 0x40;
|
|
|
|
while ((num_bits_in_value > 0) && (!(curbyte & high_bit))) {
|
|
|
|
--num_bits_in_value;
|
|
|
|
high_bit = high_bit >> 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
*value |= (curbyte & SDNV_MASK);
|
|
|
|
++offset;
|
|
|
|
++*bytecount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Process additional bytes that have the high order bit set */
|
|
|
|
while (result && ((curbyte = tvb_get_guint8(tvb, offset)) & ~SDNV_MASK)) {
|
|
|
|
/* Since the high order bit is set there must be 7 low order bits after this byte */
|
|
|
|
if (!tvb_bytes_exist(tvb, offset, 1) || ((num_bits_in_value + 7) > (32 - 7))) {
|
|
|
|
result = FALSE;
|
|
|
|
} else {
|
|
|
|
*value = *value << 7;
|
|
|
|
*value |= (curbyte & SDNV_MASK);
|
|
|
|
++offset;
|
|
|
|
++*bytecount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (result) {
|
|
|
|
/*
|
|
|
|
* Add in the byte whose high-order bit is 0 (last one)
|
|
|
|
*/
|
|
|
|
*value = *value << 7;
|
|
|
|
*value |= (curbyte & SDNV_MASK);
|
|
|
|
++*bytecount;
|
|
|
|
} else {
|
|
|
|
*bytecount = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Special Function to evaluate 64 bit unsigned SDNVs with error indication
|
|
|
|
* bytecount returns the number bytes consumed or zero on error
|
|
|
|
* value returns the actual value
|
|
|
|
*
|
|
|
|
* result is TRUE (1) on success else FALSE (0)
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
evaluate_sdnv64(tvbuff_t *tvb, int offset, int *bytecount, guint64 *value)
|
|
|
|
{
|
|
|
|
int result;
|
|
|
|
int num_bits_in_value;
|
|
|
|
guint8 curbyte;
|
|
|
|
guint8 high_bit;
|
|
|
|
|
|
|
|
*value = 0;
|
|
|
|
*bytecount = 0;
|
|
|
|
|
|
|
|
result = FALSE;
|
|
|
|
num_bits_in_value = 0;
|
|
|
|
|
|
|
|
if (tvb_bytes_exist(tvb, offset, 1)) {
|
|
|
|
/*
|
|
|
|
* Get 1st byte and continue to get them while high-order bit is 1
|
|
|
|
*/
|
|
|
|
result = TRUE;
|
|
|
|
|
|
|
|
/* Determine number of non-zero bits in first SDNV byte */
|
|
|
|
/* technically 0x80 0x80 ... 0x81 is a valid inefficient representation of "1" */
|
|
|
|
while ((0 == num_bits_in_value) && ((curbyte = tvb_get_guint8(tvb, offset)) & ~SDNV_MASK)) {
|
|
|
|
if (!tvb_bytes_exist(tvb, offset, 1)) {
|
|
|
|
result = FALSE;
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
num_bits_in_value = 7;
|
|
|
|
high_bit = 0x40;
|
|
|
|
while ((num_bits_in_value > 0) && (!(curbyte & high_bit))) {
|
|
|
|
--num_bits_in_value;
|
|
|
|
high_bit = high_bit >> 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
*value |= (curbyte & SDNV_MASK);
|
|
|
|
++offset;
|
|
|
|
++*bytecount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Process additional bytes that have the high order bit set */
|
|
|
|
while (result && ((curbyte = tvb_get_guint8(tvb, offset)) & ~SDNV_MASK)) {
|
|
|
|
/* Since the high order bit is set there must be 7 low order bits after this byte */
|
|
|
|
if (!tvb_bytes_exist(tvb, offset, 1) || ((num_bits_in_value + 7) > (64 - 7))) {
|
|
|
|
result = FALSE;
|
|
|
|
} else {
|
|
|
|
*value = *value << 7;
|
|
|
|
*value |= (curbyte & SDNV_MASK);
|
|
|
|
++offset;
|
|
|
|
++*bytecount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (result) {
|
|
|
|
/*
|
|
|
|
* Add in the byte whose high-order bit is 0 (last one)
|
|
|
|
*/
|
|
|
|
*value = *value << 7;
|
|
|
|
*value |= (curbyte & SDNV_MASK);
|
|
|
|
++*bytecount;
|
|
|
|
} else {
|
|
|
|
*bytecount = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
static guint
|
2015-01-25 19:30:13 +00:00
|
|
|
get_dtn_contact_header_len(packet_info *pinfo _U_, tvbuff_t *tvb,
|
|
|
|
int offset, void *data _U_)
|
2009-07-08 06:07:21 +00:00
|
|
|
{
|
2013-08-13 11:37:27 +00:00
|
|
|
int len, bytecount;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
/* get length from sdnv */
|
|
|
|
len = evaluate_sdnv(tvb, offset+8, &bytecount);
|
|
|
|
if (len < 0)
|
2011-04-03 15:39:01 +00:00
|
|
|
return 0;
|
2013-08-13 11:37:27 +00:00
|
|
|
|
|
|
|
return len+bytecount+8;
|
|
|
|
}
|
|
|
|
|
2013-11-09 17:46:28 +00:00
|
|
|
static int
|
|
|
|
dissect_dtn_contact_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
2013-08-13 11:37:27 +00:00
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *conv_proto_tree, *conv_tree, *conv_flag_tree;
|
2013-11-16 02:46:04 +00:00
|
|
|
int eid_length, sdnv_length;
|
|
|
|
int offset = 0;
|
2013-08-13 11:37:27 +00:00
|
|
|
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "TCPCL");
|
|
|
|
col_clear(pinfo->cinfo,COL_INFO); /* Clear out stuff in the info column */
|
2016-03-03 02:39:12 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO, "Contact Header");
|
2013-08-13 11:37:27 +00:00
|
|
|
|
|
|
|
ti = proto_tree_add_item(tree, proto_tcp_conv, tvb, offset, -1, ENC_NA);
|
|
|
|
conv_proto_tree = proto_item_add_subtree(ti, ett_tcp_conv);
|
|
|
|
|
2014-06-25 03:24:14 +00:00
|
|
|
conv_tree = proto_tree_add_subtree(conv_proto_tree, tvb, offset, -1, ett_tcp_conv, NULL, "Contact Header");
|
2013-08-13 11:37:27 +00:00
|
|
|
|
|
|
|
proto_tree_add_item(conv_tree, hf_contact_hdr_magic, tvb, offset, 4, ENC_NA|ENC_ASCII);
|
|
|
|
offset += 4;
|
|
|
|
proto_tree_add_item(conv_tree, hf_contact_hdr_version, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* Subtree to expand the bits in the Contact Header Flags */
|
|
|
|
ti = proto_tree_add_item(conv_tree, hf_contact_hdr_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
conv_flag_tree = proto_item_add_subtree(ti, ett_contact_hdr_flags);
|
|
|
|
proto_tree_add_item(conv_flag_tree, hf_contact_hdr_flags_ack_req, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(conv_flag_tree, hf_contact_hdr_flags_frag_enable, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(conv_flag_tree, hf_contact_hdr_flags_nak, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
proto_tree_add_item(conv_tree, hf_contact_hdr_keep_alive, tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* New format Contact header has length field followed by Bundle Header.
|
|
|
|
*/
|
|
|
|
eid_length = evaluate_sdnv(tvb, offset, &sdnv_length);
|
|
|
|
ti = proto_tree_add_int(tree, hf_contact_hdr_local_eid_length, tvb, offset, sdnv_length, eid_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (eid_length < 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
expert_add_info(pinfo, ti, &ei_bundle_sdnv_length);
|
2013-11-09 17:46:28 +00:00
|
|
|
return offset;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
2013-08-13 11:37:27 +00:00
|
|
|
|
|
|
|
proto_tree_add_item(conv_tree, hf_contact_hdr_local_eid, tvb, sdnv_length + offset, eid_length, ENC_NA|ENC_ASCII);
|
2015-06-23 00:19:23 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2013-08-13 11:37:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static guint
|
2015-01-25 19:30:13 +00:00
|
|
|
get_tcpcl_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
|
2013-08-13 11:37:27 +00:00
|
|
|
{
|
2013-11-16 02:46:04 +00:00
|
|
|
int len, bytecount;
|
2013-08-13 11:37:27 +00:00
|
|
|
guint8 conv_hdr = tvb_get_guint8(tvb, offset);
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
switch (conv_hdr & TCP_CONVERGENCE_TYPE_MASK)
|
2013-08-13 11:37:27 +00:00
|
|
|
{
|
|
|
|
case TCP_CONVERGENCE_DATA_SEGMENT:
|
|
|
|
/* get length from sdnv */
|
|
|
|
len = evaluate_sdnv(tvb, offset+1, &bytecount);
|
|
|
|
if (len < 0)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return len+bytecount+1;
|
2013-10-13 19:56:52 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
case TCP_CONVERGENCE_ACK_SEGMENT:
|
|
|
|
/* get length from sdnv */
|
|
|
|
len = evaluate_sdnv(tvb, offset+1, &bytecount);
|
|
|
|
if (len < 0)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return bytecount+1;
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
case TCP_CONVERGENCE_KEEP_ALIVE:
|
|
|
|
case TCP_CONVERGENCE_REFUSE_BUNDLE:
|
|
|
|
/* always 1 byte */
|
|
|
|
return 1;
|
|
|
|
case TCP_CONVERGENCE_SHUTDOWN:
|
|
|
|
len = 1;
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
if (conv_hdr & TCP_CONVERGENCE_SHUTDOWN_REASON) {
|
2013-08-13 11:37:27 +00:00
|
|
|
len += 1;
|
|
|
|
}
|
2013-11-16 02:46:04 +00:00
|
|
|
if (conv_hdr & TCP_CONVERGENCE_SHUTDOWN_DELAY) {
|
2013-08-13 11:37:27 +00:00
|
|
|
len += 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
return len;
|
2019-08-21 11:48:56 +00:00
|
|
|
|
|
|
|
case TCP_CONVERGENCE_LENGTH:
|
|
|
|
/* get length from sdnv */
|
|
|
|
len = evaluate_sdnv(tvb, offset+1, &bytecount);
|
|
|
|
if (len < 0)
|
|
|
|
return 0;
|
|
|
|
return bytecount+1;
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
}
|
|
|
|
|
2016-05-22 18:22:18 +00:00
|
|
|
/* This probably isn't a TCPCL/Bundle packet, so just stop dissection */
|
|
|
|
return -1;
|
2013-08-13 11:37:27 +00:00
|
|
|
}
|
|
|
|
|
2013-11-09 17:46:28 +00:00
|
|
|
static int
|
2016-03-03 02:39:12 +00:00
|
|
|
dissect_tcpcl_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
|
2013-08-13 11:37:27 +00:00
|
|
|
{
|
2013-11-16 02:46:04 +00:00
|
|
|
guint8 conv_hdr;
|
2019-08-21 11:48:56 +00:00
|
|
|
guint8 refuse_bundle_hdr;
|
2013-11-16 02:46:04 +00:00
|
|
|
int offset = 0;
|
|
|
|
int sdnv_length, segment_length, convergence_hdr_size;
|
2014-06-25 03:24:14 +00:00
|
|
|
proto_item *ci, *sub_item;
|
2013-11-16 02:46:04 +00:00
|
|
|
proto_tree *conv_proto_tree, *conv_tree, *sub_tree;
|
2013-08-13 11:37:27 +00:00
|
|
|
fragment_head *frag_msg;
|
|
|
|
tvbuff_t *new_tvb;
|
|
|
|
gboolean more_frags;
|
2016-03-03 02:39:12 +00:00
|
|
|
int processed_length = 0;
|
|
|
|
const gchar* col_text;
|
|
|
|
gboolean bundle_in_col_info;
|
|
|
|
|
|
|
|
static guint32 frag_id = 0;
|
|
|
|
static guint32 last_frame = 0;
|
|
|
|
static int last_raw_offset = 0;
|
|
|
|
|
|
|
|
if (last_frame != pinfo->fd->num || tvb_raw_offset(tvb) < last_raw_offset)
|
|
|
|
frag_id = 0;
|
|
|
|
last_frame = pinfo->fd->num;
|
|
|
|
last_raw_offset = tvb_raw_offset(tvb);
|
2013-08-13 11:37:27 +00:00
|
|
|
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "TCPCL");
|
|
|
|
col_clear(pinfo->cinfo,COL_INFO); /* Clear out stuff in the info column */
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
col_text = col_get_text(pinfo->cinfo, COL_INFO);
|
|
|
|
bundle_in_col_info = (col_text && strstr(col_text, " > "));
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
ci = proto_tree_add_item(tree, proto_tcp_conv, tvb, offset, -1, ENC_NA);
|
|
|
|
conv_proto_tree = proto_item_add_subtree(ci, ett_tcp_conv);
|
|
|
|
|
2014-06-25 03:24:14 +00:00
|
|
|
conv_tree = proto_tree_add_subtree(conv_proto_tree, tvb, 0, -1, ett_tcp_conv_hdr, NULL, "TCP Convergence Header");
|
2013-08-13 11:37:27 +00:00
|
|
|
|
|
|
|
conv_hdr = tvb_get_guint8(tvb, offset);
|
2014-12-13 17:52:20 +00:00
|
|
|
proto_tree_add_item(conv_tree, hf_tcp_convergence_pkt_type, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2016-03-03 02:39:12 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const((conv_hdr>>4)&0xF, packet_type_vals, "Unknown"));
|
2013-08-13 11:37:27 +00:00
|
|
|
|
|
|
|
switch (conv_hdr & TCP_CONVERGENCE_TYPE_MASK)
|
|
|
|
{
|
|
|
|
case TCP_CONVERGENCE_DATA_SEGMENT:
|
|
|
|
sub_item = proto_tree_add_item(conv_tree, hf_tcp_convergence_data_procflags, tvb,
|
|
|
|
offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
sub_tree = proto_item_add_subtree(sub_item, ett_conv_flags);
|
|
|
|
proto_tree_add_item(sub_tree, hf_tcp_convergence_data_procflags_start,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(sub_tree, hf_tcp_convergence_data_procflags_end,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
|
|
|
|
/* Only Start and End flags (bits 0 & 1) are valid in Data Segment */
|
2013-11-16 02:46:04 +00:00
|
|
|
if ((conv_hdr & ~(TCP_CONVERGENCE_TYPE_MASK | TCP_CONVERGENCE_DATA_FLAGS)) != 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
expert_add_info(pinfo, sub_item, &ei_tcp_convergence_data_flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
segment_length = evaluate_sdnv(tvb, 1, &sdnv_length);
|
|
|
|
sub_item = proto_tree_add_int(conv_tree, hf_tcp_convergence_data_segment_length, tvb, 1, sdnv_length, segment_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (segment_length < 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
expert_add_info(pinfo, sub_item, &ei_tcp_convergence_segment_length);
|
2013-11-09 17:46:28 +00:00
|
|
|
return 1;
|
2013-08-13 11:37:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
convergence_hdr_size = sdnv_length + 1;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 1/11/2006 - If I got here, I should have a complete convergence layer
|
|
|
|
* "segment" beginning at frame_offset. However that might not be a
|
|
|
|
* complete bundle. Or there might be a complete bundle plus one or more
|
|
|
|
* additional convergence layer headers.
|
|
|
|
*/
|
|
|
|
|
|
|
|
new_tvb = NULL;
|
|
|
|
sub_tree = NULL;
|
2013-11-16 02:46:04 +00:00
|
|
|
if ((conv_hdr & TCP_CONVERGENCE_DATA_END_FLAG) == TCP_CONVERGENCE_DATA_END_FLAG) {
|
2013-08-13 11:37:27 +00:00
|
|
|
more_frags = FALSE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
more_frags = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
frag_msg = fragment_add_seq_next(&msg_reassembly_table,
|
2016-03-03 02:39:12 +00:00
|
|
|
tvb, offset + convergence_hdr_size,
|
|
|
|
pinfo, frag_id, data,
|
|
|
|
segment_length, more_frags);
|
|
|
|
|
|
|
|
if (!more_frags) ++frag_id;
|
|
|
|
|
|
|
|
processed_length = convergence_hdr_size + segment_length;
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
if (frag_msg && !more_frags) {
|
2013-08-13 11:37:27 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
int save_fd_head_layer = frag_msg->reas_in_layer_num;
|
|
|
|
frag_msg->reas_in_layer_num = pinfo->curr_layer_num;
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
sub_item = proto_tree_add_item(tree, proto_bundle, tvb, offset, -1, ENC_NA);
|
|
|
|
sub_tree = proto_item_add_subtree(sub_item, ett_bundle);
|
|
|
|
|
|
|
|
new_tvb = process_reassembled_data(tvb, offset + convergence_hdr_size,
|
|
|
|
pinfo, "Reassembled DTN", frag_msg,
|
|
|
|
&msg_frag_items, NULL, sub_tree);
|
2016-03-03 02:39:12 +00:00
|
|
|
|
|
|
|
frag_msg->reas_in_layer_num = save_fd_head_layer;
|
2013-08-13 11:37:27 +00:00
|
|
|
}
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
if (new_tvb) {
|
2016-03-03 02:39:12 +00:00
|
|
|
if (0 == call_dissector_with_data(bundle_handle, new_tvb, pinfo, sub_tree, data)) {
|
2013-08-13 11:37:27 +00:00
|
|
|
/*Couldn't parse bundle, treat as raw data */
|
2016-03-20 00:33:14 +00:00
|
|
|
call_data_dissector(new_tvb, pinfo, sub_tree);
|
2015-06-23 00:19:23 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2013-08-13 11:37:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If there are 2 segments, the second of which is very short, this
|
|
|
|
* gets displayed instead of the usual Source EID/Destination EID in
|
|
|
|
* the Bundle Dissection frame. If these statements are left out entirely,
|
|
|
|
* nothing is displayed, i.e., there seems to be no way to get the
|
|
|
|
* Source/Destination in the 2-segment case. I'll leave it in because I
|
|
|
|
* think it is informative in the multi-segment case although confusing in the
|
|
|
|
* 2-segment case.
|
|
|
|
*/
|
2016-03-03 02:39:12 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO, "[Bundle TCPCL Segment]");
|
2013-08-13 11:37:27 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case TCP_CONVERGENCE_ACK_SEGMENT:
|
2016-03-03 02:39:12 +00:00
|
|
|
if (bundle_in_col_info) {
|
|
|
|
if (!strstr(col_text, ", TCPL ACK")) {
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO, ", TCPL ACK Segment(s)");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "TCPL ACK Segment(s)");
|
|
|
|
}
|
2013-08-13 11:37:27 +00:00
|
|
|
segment_length = evaluate_sdnv(tvb, offset+1, &sdnv_length);
|
|
|
|
sub_item = proto_tree_add_int(conv_tree, hf_tcp_convergence_ack_length, tvb, offset+1, sdnv_length, segment_length);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (segment_length < 0) {
|
2013-08-13 11:37:27 +00:00
|
|
|
expert_add_info(pinfo, sub_item, &ei_tcp_convergence_ack_length);
|
2016-03-03 02:39:12 +00:00
|
|
|
processed_length = tvb_captured_length(tvb);
|
|
|
|
} else {
|
|
|
|
processed_length = sdnv_length + 1;
|
2013-08-13 11:37:27 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case TCP_CONVERGENCE_KEEP_ALIVE:
|
2016-03-03 02:39:12 +00:00
|
|
|
if (bundle_in_col_info) {
|
|
|
|
if (!strstr(col_text, ", TCPL KEEPALIVE")) {
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO, ", TCPL KEEPALIVE Segment");
|
|
|
|
}
|
|
|
|
} else {
|
2018-02-06 16:28:51 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "TCPL KEEPALIVE Segment");
|
2016-03-03 02:39:12 +00:00
|
|
|
}
|
2013-08-13 11:37:27 +00:00
|
|
|
/*No valid flags in Keep Alive*/
|
2016-03-03 02:39:12 +00:00
|
|
|
processed_length = 1;
|
2013-08-13 11:37:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TCP_CONVERGENCE_SHUTDOWN:
|
2016-03-03 02:39:12 +00:00
|
|
|
if (bundle_in_col_info) {
|
|
|
|
if (!strstr(col_text, ", TCPL SHUTDOWN")) {
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO, ", TCPL SHUTDOWN Segment");
|
|
|
|
}
|
|
|
|
} else {
|
2018-02-06 16:28:51 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "TCPL SHUTDOWN Segment");
|
2016-03-03 02:39:12 +00:00
|
|
|
}
|
2013-08-13 11:37:27 +00:00
|
|
|
/* Add tree for Shutdown Flags */
|
|
|
|
sub_item = proto_tree_add_item(conv_tree, hf_tcp_convergence_shutdown_flags, tvb,
|
|
|
|
offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
sub_tree = proto_item_add_subtree(sub_item, ett_shutdown_flags);
|
|
|
|
|
|
|
|
proto_tree_add_item(sub_tree, hf_tcp_convergence_shutdown_flags_reason,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(sub_tree, hf_tcp_convergence_shutdown_flags_delay,
|
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
|
|
|
|
offset += 1;
|
2013-11-16 02:46:04 +00:00
|
|
|
if (conv_hdr & TCP_CONVERGENCE_SHUTDOWN_REASON) {
|
2013-08-13 11:37:27 +00:00
|
|
|
proto_tree_add_item(conv_tree,
|
|
|
|
hf_tcp_convergence_shutdown_reason, tvb,
|
|
|
|
offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
offset += 1;
|
|
|
|
}
|
2013-11-16 02:46:04 +00:00
|
|
|
if (conv_hdr & TCP_CONVERGENCE_SHUTDOWN_DELAY) {
|
2013-08-13 11:37:27 +00:00
|
|
|
proto_tree_add_item(conv_tree,
|
|
|
|
hf_tcp_convergence_shutdown_delay, tvb,
|
|
|
|
offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case TCP_CONVERGENCE_REFUSE_BUNDLE:
|
2016-03-03 02:39:12 +00:00
|
|
|
if (bundle_in_col_info) {
|
|
|
|
if (!strstr(col_text, ", TCPL REFUSE")) {
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO, ", TCPL REFUSE_BUNDLE Segment");
|
|
|
|
}
|
|
|
|
} else {
|
2018-02-06 16:28:51 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "TCPL REFUSE_BUNDLE Segment");
|
2016-03-03 02:39:12 +00:00
|
|
|
}
|
2019-08-21 11:48:56 +00:00
|
|
|
|
|
|
|
refuse_bundle_hdr = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(conv_tree, hf_dtn_refuse_bundle_reason_code, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO, val_to_str_const((refuse_bundle_hdr>>4)&0xF, refuse_bundle_reason_code, "Unknown"));
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
/*No valid flags*/
|
2016-03-03 02:39:12 +00:00
|
|
|
processed_length = tvb_captured_length(tvb);
|
2013-08-13 11:37:27 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
return processed_length;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
|
|
|
|
2009-09-17 01:49:55 +00:00
|
|
|
static int
|
2013-11-09 17:46:28 +00:00
|
|
|
dissect_tcpcl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
2009-07-08 06:07:21 +00:00
|
|
|
{
|
2013-08-13 11:37:27 +00:00
|
|
|
guint8 conv_hdr;
|
|
|
|
int offset, bytecount;
|
2016-03-03 02:39:12 +00:00
|
|
|
int processed_length;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
/* Make sure we have a convergence header byte */
|
|
|
|
if (!tvb_bytes_exist(tvb, 0, 1))
|
2011-04-03 15:39:01 +00:00
|
|
|
return 0;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
conv_hdr = tvb_get_guint8(tvb, 0);
|
2013-11-16 02:46:04 +00:00
|
|
|
switch (conv_hdr & TCP_CONVERGENCE_TYPE_MASK)
|
2013-08-13 11:37:27 +00:00
|
|
|
{
|
|
|
|
case TCP_CONVERGENCE_DATA_SEGMENT:
|
|
|
|
case TCP_CONVERGENCE_ACK_SEGMENT:
|
|
|
|
/* ensure sdnv */
|
|
|
|
offset = 1;
|
|
|
|
bytecount = 1;
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
if (!tvb_bytes_exist(tvb, offset, 1)) {
|
|
|
|
pinfo->desegment_offset = 0;
|
|
|
|
pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT;
|
2013-08-13 11:37:27 +00:00
|
|
|
return 0;
|
2016-03-03 02:39:12 +00:00
|
|
|
}
|
2013-08-13 11:37:27 +00:00
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
while (tvb_get_guint8(tvb, offset) & ~SDNV_MASK) {
|
2013-08-13 11:37:27 +00:00
|
|
|
if (bytecount > (int)sizeof(int)) {
|
|
|
|
/* invalid length field */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bytecount++;
|
|
|
|
offset++;
|
2016-03-03 02:39:12 +00:00
|
|
|
|
|
|
|
if (!tvb_bytes_exist(tvb, offset, 1)) {
|
|
|
|
pinfo->desegment_offset = 0;
|
|
|
|
pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT;
|
|
|
|
return 0;
|
|
|
|
}
|
2013-08-13 11:37:27 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case TCP_CONVERGENCE_KEEP_ALIVE:
|
|
|
|
case TCP_CONVERGENCE_REFUSE_BUNDLE:
|
|
|
|
/* always 1 byte */
|
|
|
|
break;
|
|
|
|
case TCP_CONVERGENCE_SHUTDOWN:
|
2013-11-16 02:46:04 +00:00
|
|
|
if ((conv_hdr &
|
2013-08-13 11:37:27 +00:00
|
|
|
~(TCP_CONVERGENCE_TYPE_MASK | TCP_CONVERGENCE_SHUTDOWN_FLAGS)) != 0) {
|
|
|
|
/* Not for us */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (conv_hdr == (guint8)magic[0]) {
|
|
|
|
if (!tvb_bytes_exist(tvb, 0, 4) || tvb_memeql(tvb, 0, magic, 4)) {
|
|
|
|
/* Not for us */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-11-09 17:46:28 +00:00
|
|
|
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 8, get_dtn_contact_header_len, dissect_dtn_contact_header, data);
|
2015-06-23 00:19:23 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2013-10-13 19:56:52 +00:00
|
|
|
}
|
2013-08-13 11:37:27 +00:00
|
|
|
|
|
|
|
/* Not for us */
|
2011-04-03 15:39:01 +00:00
|
|
|
return 0;
|
2013-08-13 11:37:27 +00:00
|
|
|
};
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
processed_length = get_tcpcl_pdu_len(pinfo, tvb, 0, data);
|
|
|
|
|
2013-11-09 17:46:28 +00:00
|
|
|
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 1, get_tcpcl_pdu_len, dissect_tcpcl_pdu, data);
|
2016-03-03 02:39:12 +00:00
|
|
|
|
|
|
|
return processed_length;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
|
|
|
|
2009-09-17 01:49:55 +00:00
|
|
|
static int
|
2013-08-13 11:37:27 +00:00
|
|
|
dissect_bundle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
|
2009-07-08 06:07:21 +00:00
|
|
|
{
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_item *ti, *ti_bundle_protocol;
|
2013-08-13 11:37:27 +00:00
|
|
|
proto_tree *bundle_tree, *primary_tree;
|
|
|
|
int primary_header_size;
|
|
|
|
gboolean lastheader = FALSE;
|
|
|
|
int offset = 0;
|
|
|
|
guint8 version, pri_hdr_procflags;
|
2013-08-15 03:05:51 +00:00
|
|
|
/* Custodian from Primary Block, used to validate CTEB */
|
2013-11-16 02:46:04 +00:00
|
|
|
gchar *bundle_custodian = NULL;
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
version = tvb_get_guint8(tvb, offset); /* Primary Header Version */
|
2013-11-16 02:46:04 +00:00
|
|
|
if ((version != 4) && (version != 5) && (version != 6)) {
|
2011-04-03 15:39:01 +00:00
|
|
|
return 0;
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
2013-08-13 11:37:27 +00:00
|
|
|
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Bundle");
|
|
|
|
/* Clear out stuff in the info column */
|
|
|
|
col_clear(pinfo->cinfo,COL_INFO);
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
ti_bundle_protocol = proto_tree_add_item(tree, proto_bundle, tvb, offset, -1, ENC_NA);
|
2018-09-17 13:22:32 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
bundle_tree = proto_item_add_subtree(ti_bundle_protocol, ett_bundle);
|
2013-08-13 11:37:27 +00:00
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
primary_tree = proto_tree_add_subtree(bundle_tree, tvb, offset, -1, ett_primary_hdr, &ti, "Primary Bundle Header");
|
2013-08-13 11:37:27 +00:00
|
|
|
|
|
|
|
proto_tree_add_item(primary_tree, hf_bundle_pdu_version, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
if (version == 4) {
|
2013-08-15 03:05:51 +00:00
|
|
|
primary_header_size = dissect_version_4_primary_header(pinfo, primary_tree, tvb,
|
|
|
|
&pri_hdr_procflags, &bundle_custodian);
|
2013-08-13 11:37:27 +00:00
|
|
|
}
|
|
|
|
else {
|
2013-08-15 03:05:51 +00:00
|
|
|
primary_header_size = dissect_version_5_and_6_primary_header(pinfo, primary_tree, tvb,
|
|
|
|
&pri_hdr_procflags, &bundle_custodian);
|
2013-08-13 11:37:27 +00:00
|
|
|
}
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
if (primary_header_size == 0) { /*Couldn't parse primary header*/
|
2016-03-03 02:39:12 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO, "Protocol Error");
|
2013-08-13 11:37:27 +00:00
|
|
|
return(0); /*Give up*/
|
|
|
|
}
|
|
|
|
|
|
|
|
proto_item_set_len(ti, primary_header_size);
|
|
|
|
offset = primary_header_size;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Done with primary header; decode the remaining headers
|
|
|
|
*/
|
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
while (lastheader == FALSE) {
|
2013-08-13 11:37:27 +00:00
|
|
|
guint8 next_header_type;
|
|
|
|
|
|
|
|
next_header_type = tvb_get_guint8(tvb, offset);
|
2013-11-16 02:46:04 +00:00
|
|
|
if (next_header_type == BUNDLE_BLOCK_TYPE_PAYLOAD) {
|
2013-08-13 11:37:27 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Returns payload size or 0 if can't parse payload
|
|
|
|
*/
|
2013-08-13 22:24:59 +00:00
|
|
|
offset = dissect_payload_header(bundle_tree, tvb, pinfo, offset, version, pri_hdr_procflags, &lastheader);
|
2013-08-13 11:37:27 +00:00
|
|
|
}
|
|
|
|
else { /*Assume anything else is a Metadata Block*/
|
2016-03-03 02:39:12 +00:00
|
|
|
offset = display_extension_block(bundle_tree, tvb, pinfo, offset, bundle_custodian, &lastheader);
|
2013-08-13 11:37:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-03 02:39:12 +00:00
|
|
|
proto_item_set_len(ti_bundle_protocol, offset);
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
return(offset);
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
void proto_reg_handoff_bundle(void);
|
|
|
|
void proto_register_bundle(void);
|
2013-08-13 11:37:27 +00:00
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
void
|
|
|
|
proto_register_bundle(void)
|
|
|
|
{
|
|
|
|
|
2011-11-09 02:48:51 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{&hf_bundle_pdu_version,
|
|
|
|
{"Bundle Version", "bundle.version",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_msg_fragments,
|
|
|
|
{"Message Fragments", "bundle.msg.fragments",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_msg_fragment,
|
|
|
|
{"Message Fragment", "bundle.msg.fragment",
|
|
|
|
FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_msg_fragment_overlap,
|
|
|
|
{"Message fragment overlap", "bundle.msg.fragment.overlap",
|
|
|
|
FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_msg_fragment_overlap_conflicts,
|
|
|
|
{"Message fragment overlapping with conflicting data",
|
|
|
|
"bundle.msg.fragment.overlap.conflicts",
|
|
|
|
FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_msg_fragment_multiple_tails,
|
|
|
|
{"Message has multiple tails", "bundle.msg.fragment.multiple_tails",
|
|
|
|
FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_msg_fragment_too_long_fragment,
|
|
|
|
{"Message fragment too long", "bundle.msg.fragment.too_long_fragment",
|
|
|
|
FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_msg_fragment_error,
|
|
|
|
{"Message defragmentation error", "bundle.msg.fragment.error",
|
|
|
|
FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_msg_fragment_count,
|
|
|
|
{"Message fragment count", "bundle.msg.fragment.count",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_msg_reassembled_in,
|
|
|
|
{"Reassembled in", "bundle.msg.reassembled.in",
|
|
|
|
FT_FRAMENUM, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_msg_reassembled_length,
|
|
|
|
{"Reassembled DTN length", "bundle.msg.reassembled.length",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_procflags,
|
|
|
|
{"Primary Header Processing Flags", "bundle.primary.proc.flag",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_procflags_fragment,
|
|
|
|
{"Bundle is a Fragment", "bundle.primary.proc.frag",
|
|
|
|
FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_FRAG_MASK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_procflags_admin,
|
|
|
|
{"Administrative Record", "bundle.primary.proc.admin",
|
|
|
|
FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_ADMIN_MASK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_procflags_dont_fragment,
|
|
|
|
{"Do Not Fragment Bundle", "bundle.primary.proc.dontfrag",
|
|
|
|
FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_DONTFRAG_MASK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_procflags_cust_xfer_req,
|
|
|
|
{"Request Custody Transfer", "bundle.primary.proc.xferreq",
|
|
|
|
FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_XFERREQ_MASK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_procflags_dest_singleton,
|
|
|
|
{"Destination is Singleton", "bundle.primary.proc.single",
|
|
|
|
FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_SINGLETON_MASK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_procflags_application_ack,
|
|
|
|
{"Request Acknowledgement by Application", "bundle.primary.proc.ack",
|
|
|
|
FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_APP_ACK_MASK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_control_flags,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Bundle Processing Control Flags", "bundle.primary.processing.control.flag",
|
2011-11-09 02:48:51 +00:00
|
|
|
FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_procflags_general,
|
|
|
|
{"General Flags", "bundle.primary.proc.gen",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_procflags_cos,
|
2016-03-03 02:39:12 +00:00
|
|
|
{"Class of Service Flags", "bundle.primary.proc.cos",
|
2011-11-09 02:48:51 +00:00
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_procflags_status,
|
|
|
|
{"Status Report Flags", "bundle.primary.proc.status",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_cosflags,
|
|
|
|
{"Primary Header COS Flags", "bundle.primary.cos.flags",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_cosflags_priority,
|
|
|
|
{"Priority", "bundle.primary.cos.priority",
|
2013-08-15 03:05:51 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(cosflags_priority_vals), BUNDLE_COSFLAGS_PRIORITY_MASK, NULL, HFILL}
|
2011-11-09 02:48:51 +00:00
|
|
|
},
|
|
|
|
{&hf_bundle_srrflags,
|
|
|
|
{"Primary Header Report Request Flags", "bundle.primary.srr.flag",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_srrflags_report_receipt,
|
|
|
|
{"Request Reception Report", "bundle.primary.srr.report",
|
|
|
|
FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_REPORT_MASK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_srrflags_report_cust_accept,
|
|
|
|
{"Request Report of Custody Acceptance", "bundle.primary.srr.custaccept",
|
|
|
|
FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_CUSTODY_MASK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_srrflags_report_forward,
|
|
|
|
{"Request Report of Bundle Forwarding", "bundle.primary.srr.forward",
|
|
|
|
FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_FORWARD_MASK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_srrflags_report_delivery,
|
|
|
|
{"Request Report of Bundle Delivery", "bundle.primary.srr.delivery",
|
|
|
|
FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_DELIVERY_MASK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_srrflags_report_deletion,
|
|
|
|
{"Request Report of Bundle Deletion", "bundle.primary.srr.delete",
|
|
|
|
FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_DELETION_MASK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_srrflags_report_ack,
|
|
|
|
{"Request Report of Application Ack", "bundle.primary.srr.ack",
|
|
|
|
FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_ACK_MASK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_primary_header_len,
|
|
|
|
{"Bundle Header Length", "bundle.primary.len",
|
2013-08-15 03:05:51 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_primary_dictionary_len,
|
|
|
|
{"Dictionary Length", "bundle.primary.dictionary_len",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_primary_fragment_offset,
|
|
|
|
{"Fragment Offset", "bundle.primary.fragment_offset",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_primary_total_adu_len,
|
|
|
|
{"Total Application Data Unit Length", "bundle.primary.total_adu_len",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_primary_timestamp_seq_num64,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Timestamp Sequence Number", "bundle.primary.timestamp_seq_num64",
|
2013-08-15 03:05:51 +00:00
|
|
|
FT_INT64, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_primary_timestamp_seq_num32,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Timestamp Sequence Number", "bundle.primary.timestamp_seq_num32",
|
2013-08-15 03:05:51 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
2011-11-09 02:48:51 +00:00
|
|
|
},
|
2013-08-13 11:37:27 +00:00
|
|
|
{&hf_bundle_primary_timestamp,
|
|
|
|
{"Timestamp", "bundle.primary.timestamp",
|
|
|
|
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2013-08-15 03:05:51 +00:00
|
|
|
{&hf_bundle_dest_scheme_offset_u16,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Destination Scheme Offset", "bundle.primary.destschemeoffu16",
|
2011-11-09 02:48:51 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2013-08-15 03:05:51 +00:00
|
|
|
{&hf_bundle_dest_scheme_offset_i32,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Destination Scheme Offset", "bundle.primary.destschemeoffi32",
|
2013-08-15 03:05:51 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_dest_ssp_offset_u16,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Destination SSP Offset", "bundle.primary.destssspoffu16",
|
2011-11-09 02:48:51 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2013-08-15 03:05:51 +00:00
|
|
|
{&hf_bundle_dest_ssp_offset_i32,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Destination SSP Offset", "bundle.primary.destssspoffi32",
|
2013-08-15 03:05:51 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_source_scheme_offset_u16,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Source Scheme Offset", "bundle.primary.srcschemeoffu16",
|
2011-11-09 02:48:51 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2013-08-15 03:05:51 +00:00
|
|
|
{&hf_bundle_source_scheme_offset_i32,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Source Scheme Offset", "bundle.primary.srcschemeoffi32",
|
2013-08-15 03:05:51 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_source_ssp_offset_u16,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Source SSP Offset", "bundle.primary.srcsspoffu16",
|
2011-11-09 02:48:51 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2013-08-15 03:05:51 +00:00
|
|
|
{&hf_bundle_source_ssp_offset_i32,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Source SSP Offset", "bundle.primary.srcsspoffi32",
|
2013-08-15 03:05:51 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_report_scheme_offset_u16,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Report Scheme Offset", "bundle.primary.rptschemeoffu16",
|
2011-11-09 02:48:51 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2013-08-15 03:05:51 +00:00
|
|
|
{&hf_bundle_report_scheme_offset_i32,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Report Scheme Offset", "bundle.primary.rptschemeoffi32",
|
2013-08-15 03:05:51 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_report_ssp_offset_u16,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Report SSP Offset", "bundle.primary.rptsspoffu16",
|
2011-11-09 02:48:51 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2013-08-15 03:05:51 +00:00
|
|
|
{&hf_bundle_report_ssp_offset_i32,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Report SSP Offset", "bundle.primary.rptsspoffi32",
|
2013-08-15 03:05:51 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_cust_scheme_offset_u16,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Custodian Scheme Offset", "bundle.primary.custschemeoffu16",
|
2011-11-09 02:48:51 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2013-08-15 03:05:51 +00:00
|
|
|
{&hf_bundle_cust_scheme_offset_i32,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Custodian Scheme Offset", "bundle.primary.custschemeoffi32",
|
2013-08-15 03:05:51 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_cust_ssp_offset_u16,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Custodian SSP Offset", "bundle.primary.custsspoffu16",
|
2011-11-09 02:48:51 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2013-08-15 03:05:51 +00:00
|
|
|
{&hf_bundle_cust_ssp_offset_i32,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Custodian SSP Offset", "bundle.primary.custsspoffi32",
|
2013-08-15 03:05:51 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2011-11-09 02:48:51 +00:00
|
|
|
{&hf_bundle_dest_scheme,
|
|
|
|
{"Destination Scheme", "bundle.primary.destination_scheme",
|
|
|
|
FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_dest_ssp,
|
|
|
|
{"Destination", "bundle.primary.destination",
|
|
|
|
FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_source_scheme,
|
|
|
|
{"Source Scheme", "bundle.primary.source_scheme",
|
|
|
|
FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_source_ssp,
|
|
|
|
{"Source", "bundle.primary.source",
|
|
|
|
FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_report_scheme,
|
|
|
|
{"Report Scheme", "bundle.primary.report_scheme",
|
|
|
|
FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_report_ssp,
|
|
|
|
{"Report", "bundle.primary.report",
|
|
|
|
FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_custodian_scheme,
|
|
|
|
{"Custodian Scheme", "bundle.primary.custodian_scheme",
|
|
|
|
FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_custodian_ssp,
|
|
|
|
{"Custodian", "bundle.primary.custodian",
|
|
|
|
FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_creation_timestamp,
|
2014-11-27 01:41:16 +00:00
|
|
|
{"Creation Timestamp", "bundle.primary.creation_timestamp",
|
2011-11-09 02:48:51 +00:00
|
|
|
FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_lifetime,
|
|
|
|
{"Lifetime", "bundle.primary.lifetime",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2013-08-15 03:05:51 +00:00
|
|
|
{&hf_bundle_lifetime_sdnv,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Lifetime", "bundle.primary.lifetime_sdnv",
|
2013-08-15 03:05:51 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2013-08-13 11:37:27 +00:00
|
|
|
{&hf_bundle_payload_length,
|
|
|
|
{"Payload Length", "bundle.payload.length",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2011-11-09 02:48:51 +00:00
|
|
|
{&hf_bundle_payload_flags,
|
|
|
|
{"Payload Header Processing Flags", "bundle.payload.proc.flag",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2014-11-01 20:55:25 +00:00
|
|
|
{&hf_bundle_payload_header_type,
|
|
|
|
{"Header Type", "bundle.payload.proc.header_type",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2016-03-03 02:39:12 +00:00
|
|
|
{&hf_bundle_payload_data,
|
|
|
|
{"Payload Data", "bundle.payload.data",
|
|
|
|
FT_STRINGZPAD, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2011-11-09 02:48:51 +00:00
|
|
|
{&hf_bundle_payload_flags_replicate_hdr,
|
|
|
|
{"Replicate Header in Every Fragment", "bundle.payload.proc.replicate",
|
|
|
|
FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_REPLICATE_MASK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_payload_flags_xmit_report,
|
|
|
|
{"Report if Can't Process Header", "bundle.payload.proc.report",
|
|
|
|
FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_XMIT_STATUS, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_payload_flags_discard_on_fail,
|
|
|
|
{"Discard if Can't Process Header", "bundle.payload.proc.discard",
|
|
|
|
FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_DISCARD_FAILURE, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_payload_flags_last_header,
|
|
|
|
{"Last Header", "bundle.payload.proc.lastheader",
|
|
|
|
FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_LAST_HEADER, NULL, HFILL}
|
|
|
|
},
|
2013-08-13 11:37:27 +00:00
|
|
|
{&hf_bundle_admin_record_type,
|
|
|
|
{"Administrative Record Type", "bundle.admin.record_type",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(admin_record_type_vals), 0xF0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_admin_record_fragment,
|
2016-03-03 02:39:12 +00:00
|
|
|
{"Administrative Record for Fragment", "bundle.admin.record_fragment",
|
2013-08-13 11:37:27 +00:00
|
|
|
FT_BOOLEAN, 8, TFS(&tfs_yes_no), ADMIN_REC_FLAGS_FRAGMENT, NULL, HFILL}
|
|
|
|
},
|
2011-11-09 02:48:51 +00:00
|
|
|
{&hf_bundle_admin_statflags,
|
|
|
|
{"Administrative Record Status Flags", "bundle.admin.status.flag",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_admin_rcvd,
|
|
|
|
{"Reporting Node Received Bundle", "bundle.admin.status.rcvd",
|
|
|
|
FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_RECEIVED, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_admin_accepted,
|
|
|
|
{"Reporting Node Accepted Custody", "bundle.admin.status.accept",
|
|
|
|
FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_ACCEPTED, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_admin_forwarded,
|
|
|
|
{"Reporting Node Forwarded Bundle", "bundle.admin.status.forward",
|
|
|
|
FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_FORWARDED, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_admin_delivered,
|
|
|
|
{"Reporting Node Delivered Bundle", "bundle.admin.status.delivered",
|
|
|
|
FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_DELIVERED, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_admin_deleted,
|
|
|
|
{"Reporting Node Deleted Bundle", "bundle.admin.status.delete",
|
|
|
|
FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_DELETED, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_admin_acked,
|
|
|
|
{"Acknowledged by Application", "bundle.admin.status.ack",
|
|
|
|
FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_ACKNOWLEDGED, NULL, HFILL}
|
|
|
|
},
|
2013-08-13 11:37:27 +00:00
|
|
|
{&hf_bundle_admin_fragment_offset,
|
|
|
|
{"Fragment Offset", "bundle.admin.fragment_offset",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_admin_fragment_length,
|
|
|
|
{"Fragment Length", "bundle.admin.fragment_length",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_admin_timestamp_seq_num64,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Timestamp Sequence Number", "bundle.admin.timestamp_seq_num64",
|
2013-08-13 11:37:27 +00:00
|
|
|
FT_INT64, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_admin_timestamp_seq_num32,
|
2020-12-15 14:15:00 +00:00
|
|
|
{"Timestamp Sequence Number", "bundle.admin.timestamp_seq_num32",
|
2013-08-13 11:37:27 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2013-08-15 03:05:51 +00:00
|
|
|
{&hf_bundle_admin_endpoint_length,
|
|
|
|
{"Endpoint Length", "bundle.admin.endpoint_length",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_admin_endpoint_id,
|
|
|
|
{"Bundle Endpoint ID", "bundle.admin.endpoint_id",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2011-11-09 02:48:51 +00:00
|
|
|
{&hf_bundle_admin_receipt_time,
|
2013-08-13 11:37:27 +00:00
|
|
|
{"Bundle Received Time", "bundle.admin.status.receipttime",
|
|
|
|
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
|
2011-11-09 02:48:51 +00:00
|
|
|
},
|
|
|
|
{&hf_bundle_admin_accept_time,
|
2013-08-13 11:37:27 +00:00
|
|
|
{"Bundle Accepted Time", "bundle.admin.status.accepttime",
|
|
|
|
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
|
2011-11-09 02:48:51 +00:00
|
|
|
},
|
|
|
|
{&hf_bundle_admin_forward_time,
|
2013-08-13 11:37:27 +00:00
|
|
|
{"Bundle Forwarded Time", "bundle.admin.status.forwardtime",
|
|
|
|
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
|
2011-11-09 02:48:51 +00:00
|
|
|
},
|
|
|
|
{&hf_bundle_admin_delivery_time,
|
2013-08-13 11:37:27 +00:00
|
|
|
{"Bundle Delivered Time", "bundle.admin.status.deliverytime",
|
|
|
|
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
|
2011-11-09 02:48:51 +00:00
|
|
|
},
|
|
|
|
{&hf_bundle_admin_delete_time,
|
2013-08-13 11:37:27 +00:00
|
|
|
{"Bundle Deleted Time", "bundle.admin.status.deletetime",
|
|
|
|
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
|
2011-11-09 02:48:51 +00:00
|
|
|
},
|
|
|
|
{&hf_bundle_admin_ack_time,
|
2013-08-13 11:37:27 +00:00
|
|
|
{"Bundle Acknowledged Time", "bundle.admin.status.acktime",
|
|
|
|
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
|
2011-11-09 02:48:51 +00:00
|
|
|
},
|
|
|
|
{&hf_bundle_admin_timestamp_copy,
|
2013-08-13 11:37:27 +00:00
|
|
|
{"Bundle Creation Timestamp", "bundle.admin.status.timecopy",
|
|
|
|
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
|
2011-11-09 02:48:51 +00:00
|
|
|
},
|
|
|
|
{&hf_bundle_admin_signal_time,
|
2013-08-13 11:37:27 +00:00
|
|
|
{"Bundle Signal Time", "bundle.admin.signal.time",
|
|
|
|
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
|
2011-11-09 02:48:51 +00:00
|
|
|
},
|
|
|
|
{&hf_block_control_flags,
|
|
|
|
{"Block Processing Control Flags", "bundle.block.control.flags",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2013-08-15 03:05:51 +00:00
|
|
|
{&hf_block_control_flags_sdnv,
|
|
|
|
{"Block Processing Control Flags", "bundle.block.control.flags",
|
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_control_block_length,
|
|
|
|
{"Block Length", "bundle.block.length",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_control_block_cteb_custody_id,
|
|
|
|
{"CTEB Custody ID", "bundle.block.cteb_custody_id",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_control_block_cteb_creator_custodian_eid,
|
|
|
|
{"CTEB Creator Custodian EID", "bundle.block.cteb_creator_custodian_eid",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2011-11-09 02:48:51 +00:00
|
|
|
{&hf_block_control_replicate,
|
|
|
|
{"Replicate Block in Every Fragment", "bundle.block.control.replicate",
|
|
|
|
FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_REPLICATE, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_control_transmit_status,
|
2020-08-31 11:39:37 +00:00
|
|
|
{"Transmit Status if Block Can't be Processed", "bundle.block.control.status",
|
2011-11-09 02:48:51 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_TRANSMIT_STATUS, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_control_delete_bundle,
|
2020-08-31 11:39:37 +00:00
|
|
|
{"Delete Bundle if Block Can't be Processed", "bundle.block.control.delete",
|
2011-11-09 02:48:51 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_DELETE_BUNDLE, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_control_last_block,
|
|
|
|
{"Last Block", "bundle.block.control.last",
|
|
|
|
FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_LAST_BLOCK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_control_discard_block,
|
|
|
|
{"Discard Block If Can't Process", "bundle.block.control.discard",
|
|
|
|
FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_DISCARD_BLOCK, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_control_not_processed,
|
|
|
|
{"Block Was Forwarded Without Processing", "bundle.block.control.process",
|
|
|
|
FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_NOT_PROCESSED, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_control_eid_reference,
|
|
|
|
{"Block Contains an EID-reference Field", "bundle.block.control.eid",
|
|
|
|
FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_EID_REFERENCE, NULL, HFILL}
|
2012-05-02 12:47:59 +00:00
|
|
|
},
|
2012-05-08 14:17:16 +00:00
|
|
|
{&hf_bundle_status_report_reason_code,
|
|
|
|
{"Status Report Reason Code", "bundle.status_report_reason_code",
|
2012-05-02 12:47:59 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(status_report_reason_codes), 0x0, NULL, HFILL}
|
|
|
|
},
|
2012-05-08 14:17:16 +00:00
|
|
|
{&hf_bundle_custody_trf_succ_flg,
|
2012-05-02 12:47:59 +00:00
|
|
|
{"Custody Transfer Succeeded Flag", "bundle.custody_trf_succ_flg",
|
|
|
|
FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
|
|
|
|
},
|
2012-05-08 14:17:16 +00:00
|
|
|
{&hf_bundle_custody_signal_reason,
|
|
|
|
{"Custody Signal Reason Code", "bundle.custody_signal_reason_code",
|
2012-05-02 12:47:59 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(custody_signal_reason_codes), ADMIN_REC_CUSTODY_REASON_MASK, NULL, HFILL}
|
|
|
|
},
|
2013-08-15 03:05:51 +00:00
|
|
|
{&hf_bundle_custody_id_range_start,
|
|
|
|
{"CTEB Custody ID Range Start", "bundle.custody_id_range_start",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_custody_id_range_end,
|
|
|
|
{"CTEB Custody ID Range End", "bundle.custody_id_range_end",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2012-05-08 14:17:16 +00:00
|
|
|
{&hf_bundle_block_type_code,
|
2016-03-03 02:39:12 +00:00
|
|
|
{"Block Type Code", "bundle.block_type_code",
|
2012-05-08 14:17:16 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(bundle_block_type_codes), 0x0, NULL, HFILL}
|
|
|
|
},
|
2016-03-03 02:39:12 +00:00
|
|
|
{&hf_bundle_unprocessed_block_data,
|
|
|
|
{"Block Data", "bundle.block_data",
|
|
|
|
FT_STRINGZPAD, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2012-05-23 06:25:00 +00:00
|
|
|
{&hf_ecos_flags,
|
|
|
|
{"ECOS Flags", "bundle.block.ecos.flags",
|
2016-06-25 14:13:00 +00:00
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
2012-05-23 06:25:00 +00:00
|
|
|
},
|
|
|
|
{&hf_ecos_flags_critical,
|
2016-06-25 14:13:00 +00:00
|
|
|
{"Critical", "bundle.block.ecos.flags.critical",
|
2012-05-23 06:25:00 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, ECOS_FLAGS_CRITICAL, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_ecos_flags_streaming,
|
2016-06-25 14:13:00 +00:00
|
|
|
{"Streaming", "bundle.block.ecos.flags.streaming",
|
2012-05-23 06:25:00 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, ECOS_FLAGS_STREAMING, NULL, HFILL}
|
|
|
|
},
|
2016-03-03 02:39:12 +00:00
|
|
|
{&hf_ecos_flags_flowlabel,
|
2016-06-25 14:13:00 +00:00
|
|
|
{"Flow Label", "bundle.block.ecos.flags.flowlabel",
|
2016-03-03 02:39:12 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, ECOS_FLAGS_FLOWLABEL, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_ecos_flags_reliable,
|
2016-06-25 14:13:00 +00:00
|
|
|
{"Reliable", "bundle.block.ecos.flags.reliable",
|
2016-03-03 02:39:12 +00:00
|
|
|
FT_BOOLEAN, 8, NULL, ECOS_FLAGS_RELIABLE, NULL, HFILL}
|
2012-05-23 06:25:00 +00:00
|
|
|
},
|
2013-08-15 03:05:51 +00:00
|
|
|
{&hf_ecos_flow_label,
|
|
|
|
{"ECOS Flow Label", "bundle.block.ecos.flow_label",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2012-05-23 06:25:00 +00:00
|
|
|
{&hf_ecos_ordinal,
|
|
|
|
{"ECOS Ordinal", "bundle.block.ecos.ordinal",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2018-09-17 13:22:32 +00:00
|
|
|
{&hf_bundle_age_extension_block_code,
|
|
|
|
{"Bundle Age in seconds", "bundle.age_extension_block_code",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_block_previous_hop_scheme,
|
2020-08-31 11:39:37 +00:00
|
|
|
{"Previous Hop Scheme", "bundle.block.previous_hop_scheme",
|
2018-09-17 13:22:32 +00:00
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_block_previous_hop_eid,
|
|
|
|
{"Previous Hop EID", "bundle.block.previous_hop_eid",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_target_block_type,
|
|
|
|
{"Target Block Type", "bundle.target_block_type",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2018-10-12 06:07:20 +00:00
|
|
|
{&hf_bundle_target_block_occurrence,
|
|
|
|
{"Target Block Occurrence", "bundle.target_block_occurrence",
|
2018-09-17 13:22:32 +00:00
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_ciphersuite_type,
|
|
|
|
{"Ciphersuite Type", "bundle.ciphersuite_type",
|
|
|
|
FT_INT32, BASE_DEC, VALS(ciphersuite_types), 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_bundle_ciphersuite_flags,
|
|
|
|
{"Ciphersuite Flags", "bundle.ciphersuite_flags",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_ciphersuite_params,
|
|
|
|
{"Block Contains Ciphersuite Parameters", "bundle.block.ciphersuite_params",
|
|
|
|
FT_BOOLEAN, 8, NULL, BLOCK_CIPHERSUITE_PARAMS, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_ciphersuite_params_length,
|
|
|
|
{"Ciphersuite Parameters Length", "bundle.block.ciphersuite_params_length",
|
|
|
|
FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_ciphersuite_params_item_length,
|
|
|
|
{"Parameter Length", "bundle.block.ciphersuite_params_item_length",
|
|
|
|
FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_ciphersuite_param_type,
|
|
|
|
{"Ciphersuite Parameter Type", "bundle.block.ciphersuite_param_type",
|
|
|
|
FT_INT8, BASE_DEC, VALS(res_params_types), 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_ciphersuite_param_data,
|
|
|
|
{"Ciphersuite Parameter Data", "bundle.block.ciphersuite_param_data",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_ciphersuite_result_length,
|
|
|
|
{"Security Results Length", "bundle.block.ciphersuite_result_length",
|
|
|
|
FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_ciphersuite_result_item_length,
|
|
|
|
{"Security Result Item Length", "bundle.block.ciphersuite_result_item_length",
|
|
|
|
FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_ciphersuite_result_type,
|
|
|
|
{"Security Result Item Type", "bundle.block.ciphersuite_result_type",
|
|
|
|
FT_INT8, BASE_DEC, VALS(res_params_types), 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_ciphersuite_result_data,
|
|
|
|
{"Security Result Item Data", "bundle.block.ciphersuite_result_data",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_ciphersuite_range_offset,
|
|
|
|
{"Content Range Offset", "bundle.block.ciphersuite_range_offset",
|
|
|
|
FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_block_ciphersuite_range_length,
|
|
|
|
{"Content Range Length", "bundle.block.ciphersuite_range_length",
|
|
|
|
FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
2011-11-09 02:48:51 +00:00
|
|
|
};
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
static hf_register_info hf_tcpcl[] = {
|
|
|
|
{&hf_tcp_convergence_pkt_type,
|
|
|
|
{"Pkt Type", "tcpcl.pkt_type",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(packet_type_vals), 0xF0, NULL, HFILL}
|
|
|
|
},
|
2019-08-21 11:48:56 +00:00
|
|
|
{&hf_dtn_refuse_bundle_reason_code,
|
|
|
|
{"Reason-Code", "tcpcl.refuse.reason_code",
|
2020-04-01 21:54:43 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(refuse_bundle_reason_code), 0x0F, NULL, HFILL}
|
2019-08-21 11:48:56 +00:00
|
|
|
},
|
2013-08-13 11:37:27 +00:00
|
|
|
{&hf_tcp_convergence_data_procflags,
|
|
|
|
{"TCP Convergence Data Flags", "tcpcl.data.proc.flag",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, TCP_CONVERGENCE_DATA_FLAGS, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_tcp_convergence_data_procflags_start,
|
|
|
|
{"Segment contains start of bundle", "tcpcl.data.proc.start",
|
|
|
|
FT_BOOLEAN, 8, NULL, TCP_CONVERGENCE_DATA_START_FLAG, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_tcp_convergence_data_procflags_end,
|
|
|
|
{"Segment contains end of Bundle", "tcpcl.data.proc.end",
|
|
|
|
FT_BOOLEAN, 8, NULL, TCP_CONVERGENCE_DATA_END_FLAG, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_tcp_convergence_data_segment_length,
|
|
|
|
{"Segment Length", "tcpcl.data.length",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_tcp_convergence_shutdown_flags,
|
|
|
|
{"TCP Convergence Shutdown Flags", "tcpcl.shutdown.flags",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, TCP_CONVERGENCE_SHUTDOWN_FLAGS, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_tcp_convergence_shutdown_flags_reason,
|
|
|
|
{"Shutdown includes Reason Code", "tcpcl.shutdown.reason.flag",
|
|
|
|
FT_BOOLEAN, 8, NULL, TCP_CONVERGENCE_SHUTDOWN_REASON, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_tcp_convergence_shutdown_flags_delay,
|
|
|
|
{"Shutdown includes Reconnection Delay", "tcpcl.shutdown.delay.flag",
|
|
|
|
FT_BOOLEAN, 8, NULL, TCP_CONVERGENCE_SHUTDOWN_DELAY, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_tcp_convergence_shutdown_reason,
|
|
|
|
{"Shutdown Reason Code", "tcpcl.shutdown.reason",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_tcp_convergence_shutdown_delay,
|
|
|
|
{"Shutdown Reconnection Delay", "tcpcl.shutdown.delay",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_tcp_convergence_ack_length,
|
|
|
|
{"Ack Length", "tcpcl.ack.length",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_contact_hdr_version,
|
|
|
|
{"Version", "tcpcl.contact_hdr.version",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_contact_hdr_flags,
|
|
|
|
{"Flags", "tcpcl.contact_hdr.flags",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_contact_hdr_flags_ack_req,
|
|
|
|
{"Bundle Acks Requested", "tcpcl.contact_hdr.flags.ackreq",
|
|
|
|
FT_BOOLEAN, 8, NULL, TCP_CONV_BUNDLE_ACK_FLAG, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_contact_hdr_flags_frag_enable,
|
|
|
|
{"Reactive Fragmentation Enabled", "tcpcl.contact_hdr.flags.fragen",
|
|
|
|
FT_BOOLEAN, 8, NULL, TCP_CONV_REACTIVE_FRAG_FLAG, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_contact_hdr_flags_nak,
|
|
|
|
{"Support Negative Acknowledgements", "tcpcl.contact_hdr.flags.nak",
|
|
|
|
FT_BOOLEAN, 8, NULL, TCP_CONV_CONNECTOR_RCVR_FLAG, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_contact_hdr_keep_alive,
|
|
|
|
{"Keep Alive", "tcpcl.contact_hdr.keep_alive",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_contact_hdr_magic,
|
|
|
|
{"Magic", "tcpcl.contact_hdr.magic",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_contact_hdr_local_eid,
|
|
|
|
{"Local EID", "tcpcl.contact_hdr.local_eid",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
{&hf_contact_hdr_local_eid_length,
|
|
|
|
{"Local EID Length", "tcpcl.contact_hdr.local_eid_length",
|
|
|
|
FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-11-09 02:48:51 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_bundle,
|
|
|
|
&ett_bundle_hdr,
|
|
|
|
&ett_primary_hdr,
|
|
|
|
&ett_proc_flags,
|
|
|
|
&ett_gen_flags,
|
|
|
|
&ett_cos_flags,
|
|
|
|
&ett_srr_flags,
|
|
|
|
&ett_dictionary,
|
|
|
|
&ett_payload_hdr,
|
|
|
|
&ett_payload_flags,
|
|
|
|
&ett_block_flags,
|
|
|
|
&ett_contact_hdr_flags,
|
|
|
|
&ett_conv_flags,
|
|
|
|
&ett_shutdown_flags,
|
|
|
|
&ett_admin_record,
|
|
|
|
&ett_admin_rec_status,
|
2018-09-17 13:22:32 +00:00
|
|
|
&ett_metadata_hdr,
|
|
|
|
&ett_sec_block_param_data
|
2011-11-09 02:48:51 +00:00
|
|
|
};
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
static gint *ett_tcpcl[] = {
|
|
|
|
&ett_tcp_conv,
|
|
|
|
&ett_tcp_conv_hdr,
|
|
|
|
&ett_msg_fragment,
|
|
|
|
&ett_msg_fragments,
|
|
|
|
};
|
|
|
|
|
2013-05-25 17:06:40 +00:00
|
|
|
static ei_register_info ei[] = {
|
2013-11-16 02:46:04 +00:00
|
|
|
{ &ei_bundle_control_flags_length,
|
|
|
|
{ "bundle.block.control.flags.length", PI_UNDECODED, PI_WARN, "Wrong bundle control flag length", EXPFILL }
|
|
|
|
},
|
|
|
|
{ &ei_bundle_payload_length,
|
|
|
|
{ "bundle.payload.length.invalid", PI_PROTOCOL, PI_ERROR, "Payload length error", EXPFILL }
|
|
|
|
},
|
|
|
|
{ &ei_bundle_sdnv_length,
|
|
|
|
{ "bundle.sdnv_length_invalid", PI_PROTOCOL, PI_ERROR, "SDNV length error", EXPFILL }
|
|
|
|
},
|
|
|
|
{ &ei_bundle_timestamp_seq_num,
|
|
|
|
{ "bundle.timestamp_seq_num_invalid", PI_PROTOCOL, PI_ERROR, "Timestamp Sequence Number error", EXPFILL }
|
|
|
|
},
|
|
|
|
{ &ei_bundle_offset_error,
|
|
|
|
{ "bundle.offset_error", PI_PROTOCOL, PI_WARN, "Offset field error", EXPFILL }
|
|
|
|
},
|
|
|
|
{ &ei_bundle_block_control_flags,
|
|
|
|
{ "bundle.block.control.flags.error", PI_PROTOCOL, PI_WARN, "Control flag error", EXPFILL }
|
|
|
|
},
|
|
|
|
{ &ei_block_control_block_cteb_invalid,
|
|
|
|
{ "bundle.block.control.cteb_invalid", PI_PROTOCOL, PI_WARN, "CTEB Is Invalid", EXPFILL }
|
|
|
|
},
|
|
|
|
{ &ei_block_control_block_cteb_valid,
|
|
|
|
{ "bundle.block.control.cteb_valid", PI_PROTOCOL, PI_NOTE, "CTEB Is Valid", EXPFILL }
|
|
|
|
},
|
2013-08-13 11:37:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static ei_register_info ei_tcpcl[] = {
|
2013-11-16 02:46:04 +00:00
|
|
|
{ &ei_tcp_convergence_data_flags,
|
|
|
|
{ "tcpcl.data.flags.invalid", PI_PROTOCOL, PI_WARN, "Invalid TCP CL Data Segment Flags", EXPFILL }
|
|
|
|
},
|
|
|
|
{ &ei_tcp_convergence_segment_length,
|
|
|
|
{ "tcpcl.data.length.invalid", PI_PROTOCOL, PI_ERROR, "Invalid Data Length", EXPFILL }
|
|
|
|
},
|
|
|
|
{ &ei_tcp_convergence_ack_length,
|
|
|
|
{ "tcpcl.ack.length.error", PI_PROTOCOL, PI_WARN, "Ack Length: Error", EXPFILL }
|
|
|
|
},
|
2013-05-25 17:06:40 +00:00
|
|
|
};
|
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
expert_module_t *expert_bundle, *expert_tcpcl;
|
2011-11-09 02:48:51 +00:00
|
|
|
|
2013-11-16 02:46:04 +00:00
|
|
|
proto_bundle = proto_register_protocol("Bundle Protocol", "Bundle", "bundle");
|
2015-12-09 04:04:01 +00:00
|
|
|
bundle_handle = register_dissector("bundle", dissect_bundle, proto_bundle);
|
2011-11-09 02:48:51 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
proto_tcp_conv = proto_register_protocol ("DTN TCP Convergence Layer Protocol", "TCPCL", "tcpcl");
|
2011-11-09 02:48:51 +00:00
|
|
|
|
|
|
|
proto_register_field_array(proto_bundle, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2013-05-25 17:06:40 +00:00
|
|
|
expert_bundle = expert_register_protocol(proto_bundle);
|
|
|
|
expert_register_field_array(expert_bundle, ei, array_length(ei));
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2013-08-13 11:37:27 +00:00
|
|
|
proto_register_field_array(proto_tcp_conv, hf_tcpcl, array_length(hf_tcpcl));
|
|
|
|
proto_register_subtree_array(ett_tcpcl, array_length(ett_tcpcl));
|
|
|
|
expert_tcpcl = expert_register_protocol(proto_tcp_conv);
|
|
|
|
expert_register_field_array(expert_tcpcl, ei_tcpcl, array_length(ei_tcpcl));
|
2009-07-08 06:07:21 +00:00
|
|
|
|
2017-01-29 00:53:36 +00:00
|
|
|
reassembly_table_register(&msg_reassembly_table,
|
|
|
|
&addresses_reassembly_table_functions);
|
2018-09-17 13:22:32 +00:00
|
|
|
|
2009-07-08 06:07:21 +00:00
|
|
|
}
|
2013-11-16 02:46:04 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_bundle(void)
|
|
|
|
{
|
2016-10-05 20:33:54 +00:00
|
|
|
dissector_handle_t tcpcl_handle;
|
2013-11-16 02:46:04 +00:00
|
|
|
|
2016-10-05 20:33:54 +00:00
|
|
|
tcpcl_handle = create_dissector_handle(dissect_tcpcl, proto_bundle);
|
|
|
|
dissector_add_uint_with_preference("tcp.port", BUNDLE_PORT, tcpcl_handle);
|
|
|
|
dissector_add_uint_with_preference("udp.port", BUNDLE_PORT, bundle_handle);
|
2013-11-16 02:46:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-07-26 18:43:17 +00:00
|
|
|
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
2013-11-16 02:46:04 +00:00
|
|
|
*
|
|
|
|
* 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:
|
|
|
|
*/
|