2006-04-14 13:12:13 +00:00
|
|
|
/* packet-catapult-dct2000.c
|
|
|
|
* Routines for Catapult DCT2000 packet stub header disassembly
|
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2006-04-14 13:12:13 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2006-04-14 13:12:13 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2006-04-14 13:12:13 +00:00
|
|
|
|
2009-10-26 15:39:00 +00:00
|
|
|
#include <stdio.h>
|
2009-10-28 19:00:41 +00:00
|
|
|
|
2006-04-14 13:12:13 +00:00
|
|
|
#include <epan/packet.h>
|
2012-05-07 17:37:30 +00:00
|
|
|
#include <epan/conversation.h>
|
2009-10-28 19:00:41 +00:00
|
|
|
#include <epan/expert.h>
|
2006-04-14 13:12:13 +00:00
|
|
|
#include <epan/prefs.h>
|
2006-09-05 16:05:23 +00:00
|
|
|
#include <epan/addr_resolv.h>
|
2016-01-25 01:10:20 +00:00
|
|
|
#include <epan/proto_data.h>
|
2006-04-14 13:12:13 +00:00
|
|
|
|
2016-10-22 18:59:44 +00:00
|
|
|
#include <wsutil/strtoi.h>
|
|
|
|
|
2006-06-20 18:30:54 +00:00
|
|
|
#include <wiretap/catapult_dct2000.h>
|
2006-09-04 11:04:14 +00:00
|
|
|
#include "packet-umts_fp.h"
|
2017-06-17 20:27:33 +00:00
|
|
|
#include "packet-umts_rlc.h"
|
2011-10-28 18:36:20 +00:00
|
|
|
|
2008-12-23 21:22:47 +00:00
|
|
|
#include "packet-mac-lte.h"
|
|
|
|
#include "packet-rlc-lte.h"
|
2009-01-23 15:58:33 +00:00
|
|
|
#include "packet-pdcp-lte.h"
|
2006-04-14 13:12:13 +00:00
|
|
|
|
2013-12-15 23:44:12 +00:00
|
|
|
void proto_reg_handoff_catapult_dct2000(void);
|
|
|
|
void proto_register_catapult_dct2000(void);
|
|
|
|
|
2006-04-14 13:12:13 +00:00
|
|
|
/* Protocol and registered fields. */
|
|
|
|
static int proto_catapult_dct2000 = -1;
|
|
|
|
|
|
|
|
static int hf_catapult_dct2000_context = -1;
|
|
|
|
static int hf_catapult_dct2000_port_number = -1;
|
|
|
|
static int hf_catapult_dct2000_timestamp = -1;
|
|
|
|
static int hf_catapult_dct2000_protocol = -1;
|
2006-05-23 05:48:00 +00:00
|
|
|
static int hf_catapult_dct2000_variant = -1;
|
2006-08-02 09:30:28 +00:00
|
|
|
static int hf_catapult_dct2000_outhdr = -1;
|
2006-04-14 13:12:13 +00:00
|
|
|
static int hf_catapult_dct2000_direction = -1;
|
|
|
|
static int hf_catapult_dct2000_encap = -1;
|
|
|
|
static int hf_catapult_dct2000_unparsed_data = -1;
|
2009-10-26 00:04:27 +00:00
|
|
|
static int hf_catapult_dct2000_comment = -1;
|
2013-02-15 23:43:30 +00:00
|
|
|
static int hf_catapult_dct2000_sprint = -1;
|
2010-05-25 14:02:17 +00:00
|
|
|
static int hf_catapult_dct2000_error_comment = -1;
|
2007-09-17 16:03:49 +00:00
|
|
|
static int hf_catapult_dct2000_tty = -1;
|
|
|
|
static int hf_catapult_dct2000_tty_line = -1;
|
2006-12-21 18:00:07 +00:00
|
|
|
static int hf_catapult_dct2000_dissected_length = -1;
|
2006-04-14 13:12:13 +00:00
|
|
|
|
2006-10-05 14:10:10 +00:00
|
|
|
static int hf_catapult_dct2000_ipprim_addresses = -1;
|
2007-09-28 16:17:22 +00:00
|
|
|
static int hf_catapult_dct2000_ipprim_src_addr_v4 = -1;
|
|
|
|
static int hf_catapult_dct2000_ipprim_src_addr_v6 = -1;
|
|
|
|
static int hf_catapult_dct2000_ipprim_dst_addr_v4 = -1;
|
|
|
|
static int hf_catapult_dct2000_ipprim_dst_addr_v6 = -1;
|
|
|
|
static int hf_catapult_dct2000_ipprim_addr_v4 = -1;
|
|
|
|
static int hf_catapult_dct2000_ipprim_addr_v6 = -1;
|
2006-10-05 14:10:10 +00:00
|
|
|
static int hf_catapult_dct2000_ipprim_udp_src_port = -1;
|
|
|
|
static int hf_catapult_dct2000_ipprim_udp_dst_port = -1;
|
|
|
|
static int hf_catapult_dct2000_ipprim_udp_port = -1;
|
|
|
|
static int hf_catapult_dct2000_ipprim_tcp_src_port = -1;
|
|
|
|
static int hf_catapult_dct2000_ipprim_tcp_dst_port = -1;
|
|
|
|
static int hf_catapult_dct2000_ipprim_tcp_port = -1;
|
2007-04-11 14:34:56 +00:00
|
|
|
static int hf_catapult_dct2000_ipprim_conn_id = -1;
|
2006-10-05 14:10:10 +00:00
|
|
|
|
2008-01-16 14:19:45 +00:00
|
|
|
static int hf_catapult_dct2000_sctpprim_addresses = -1;
|
|
|
|
static int hf_catapult_dct2000_sctpprim_dst_addr_v4 = -1;
|
|
|
|
static int hf_catapult_dct2000_sctpprim_dst_addr_v6 = -1;
|
|
|
|
static int hf_catapult_dct2000_sctpprim_addr_v4 = -1;
|
|
|
|
static int hf_catapult_dct2000_sctpprim_addr_v6 = -1;
|
|
|
|
static int hf_catapult_dct2000_sctpprim_dst_port = -1;
|
|
|
|
|
2009-01-02 01:37:55 +00:00
|
|
|
static int hf_catapult_dct2000_lte_ueid = -1;
|
|
|
|
static int hf_catapult_dct2000_lte_srbid = -1;
|
|
|
|
static int hf_catapult_dct2000_lte_drbid = -1;
|
|
|
|
static int hf_catapult_dct2000_lte_cellid = -1;
|
|
|
|
static int hf_catapult_dct2000_lte_bcch_transport = -1;
|
2009-01-23 15:58:33 +00:00
|
|
|
static int hf_catapult_dct2000_lte_rlc_op = -1;
|
|
|
|
static int hf_catapult_dct2000_lte_rlc_channel_type = -1;
|
|
|
|
static int hf_catapult_dct2000_lte_rlc_mui = -1;
|
|
|
|
static int hf_catapult_dct2000_lte_rlc_cnf = -1;
|
|
|
|
static int hf_catapult_dct2000_lte_rlc_discard_req = -1;
|
2009-01-02 01:37:55 +00:00
|
|
|
|
2009-12-29 22:57:10 +00:00
|
|
|
static int hf_catapult_dct2000_lte_ccpri_opcode = -1;
|
|
|
|
static int hf_catapult_dct2000_lte_ccpri_status = -1;
|
|
|
|
static int hf_catapult_dct2000_lte_ccpri_channel = -1;
|
2006-09-05 16:05:23 +00:00
|
|
|
|
2012-03-29 01:24:49 +00:00
|
|
|
static int hf_catapult_dct2000_lte_nas_rrc_opcode = -1;
|
|
|
|
static int hf_catapult_dct2000_lte_nas_rrc_establish_cause = -1;
|
|
|
|
static int hf_catapult_dct2000_lte_nas_rrc_priority = -1;
|
|
|
|
static int hf_catapult_dct2000_lte_nas_rrc_release_cause = -1;
|
|
|
|
|
|
|
|
|
2011-11-14 12:22:54 +00:00
|
|
|
/* UMTS RLC fields */
|
2011-11-03 16:52:37 +00:00
|
|
|
static int hf_catapult_dct2000_ueid = -1;
|
|
|
|
static int hf_catapult_dct2000_rbid = -1;
|
|
|
|
static int hf_catapult_dct2000_ccch_id = -1;
|
|
|
|
static int hf_catapult_dct2000_no_crc_error = -1;
|
|
|
|
static int hf_catapult_dct2000_crc_error = -1;
|
|
|
|
static int hf_catapult_dct2000_clear_tx_buffer = -1;
|
2011-11-14 12:22:54 +00:00
|
|
|
static int hf_catapult_dct2000_buffer_occupancy = -1;
|
|
|
|
static int hf_catapult_dct2000_pdu_size = -1;
|
|
|
|
static int hf_catapult_dct2000_ueid_type = -1;
|
|
|
|
static int hf_catapult_dct2000_tx_priority = -1;
|
|
|
|
static int hf_catapult_dct2000_last_in_seg_set = -1;
|
|
|
|
static int hf_catapult_dct2000_rx_timing_deviation = -1;
|
|
|
|
static int hf_catapult_dct2000_transport_channel_type = -1;
|
|
|
|
static int hf_catapult_dct2000_no_padding_bits = -1;
|
2011-11-03 16:52:37 +00:00
|
|
|
|
2006-05-23 05:48:00 +00:00
|
|
|
/* Variables used for preferences */
|
2009-03-29 22:16:26 +00:00
|
|
|
static gboolean catapult_dct2000_try_ipprim_heuristic = TRUE;
|
|
|
|
static gboolean catapult_dct2000_try_sctpprim_heuristic = TRUE;
|
2009-07-07 14:38:14 +00:00
|
|
|
static gboolean catapult_dct2000_dissect_lte_rrc = TRUE;
|
2009-08-15 01:29:29 +00:00
|
|
|
static gboolean catapult_dct2000_dissect_lte_s1ap = TRUE;
|
2009-10-26 16:40:57 +00:00
|
|
|
static gboolean catapult_dct2000_dissect_mac_lte_oob_messages = TRUE;
|
2006-04-14 13:12:13 +00:00
|
|
|
|
|
|
|
/* Protocol subtree. */
|
|
|
|
static int ett_catapult_dct2000 = -1;
|
2006-10-05 14:10:10 +00:00
|
|
|
static int ett_catapult_dct2000_ipprim = -1;
|
2008-01-16 14:19:45 +00:00
|
|
|
static int ett_catapult_dct2000_sctpprim = -1;
|
2007-09-17 16:03:49 +00:00
|
|
|
static int ett_catapult_dct2000_tty = -1;
|
2006-04-14 13:12:13 +00:00
|
|
|
|
2013-05-25 17:06:40 +00:00
|
|
|
static expert_field ei_catapult_dct2000_lte_ccpri_status_error = EI_INIT;
|
|
|
|
static expert_field ei_catapult_dct2000_error_comment_expert = EI_INIT;
|
2016-10-22 18:59:44 +00:00
|
|
|
static expert_field ei_catapult_dct2000_string_invalid = EI_INIT;
|
2013-05-25 17:06:40 +00:00
|
|
|
|
2006-04-14 13:12:13 +00:00
|
|
|
static const value_string direction_vals[] = {
|
2006-08-02 09:30:28 +00:00
|
|
|
{ 0, "Sent" },
|
|
|
|
{ 1, "Received" },
|
2006-04-14 13:12:13 +00:00
|
|
|
{ 0, NULL },
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string encap_vals[] = {
|
|
|
|
{ WTAP_ENCAP_RAW_IP, "Raw IP" },
|
|
|
|
{ WTAP_ENCAP_ETHERNET, "Ethernet" },
|
|
|
|
{ WTAP_ENCAP_ISDN, "LAPD" },
|
|
|
|
{ WTAP_ENCAP_ATM_PDUS_UNTRUNCATED, "ATM (PDUs untruncated)" },
|
|
|
|
{ WTAP_ENCAP_PPP, "PPP" },
|
|
|
|
{ DCT2000_ENCAP_SSCOP, "SSCOP" },
|
|
|
|
{ WTAP_ENCAP_FRELAY, "Frame Relay" },
|
|
|
|
{ WTAP_ENCAP_MTP2, "MTP2" },
|
2006-10-25 16:46:27 +00:00
|
|
|
{ DCT2000_ENCAP_NBAP, "NBAP" },
|
2007-06-29 16:16:57 +00:00
|
|
|
{ DCT2000_ENCAP_UNHANDLED, "No Direct Encapsulation" },
|
2006-04-14 13:12:13 +00:00
|
|
|
{ 0, NULL },
|
|
|
|
};
|
|
|
|
|
2009-01-02 01:37:55 +00:00
|
|
|
static const value_string bcch_transport_vals[] = {
|
2009-05-11 15:19:51 +00:00
|
|
|
{ BCH_TRANSPORT, "BCH" },
|
|
|
|
{ DLSCH_TRANSPORT, "DLSCH" },
|
2009-01-02 01:37:55 +00:00
|
|
|
{ 0, NULL },
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-01-23 15:58:33 +00:00
|
|
|
#define RLC_MGMT_ASSIGN 0x41
|
|
|
|
#define RLC_AM_DATA_REQ 0x60
|
|
|
|
#define RLC_AM_DATA_IND 0x61
|
|
|
|
#define RLC_AM_DATA_CONF 0x62
|
|
|
|
#define RLC_UM_DATA_REQ 0x70
|
|
|
|
#define RLC_UM_DATA_IND 0x71
|
|
|
|
#define RLC_UM_DATA_CONF 0x74
|
|
|
|
#define RLC_TR_DATA_REQ 0x80
|
|
|
|
#define RLC_TR_DATA_IND 0x81
|
|
|
|
#define RLC_TR_DATA_CONF 0x83
|
|
|
|
|
|
|
|
static const value_string rlc_op_vals[] = {
|
2009-05-13 09:36:42 +00:00
|
|
|
{ RLC_AM_DATA_REQ, "[UL] [AM]" },
|
|
|
|
{ RLC_AM_DATA_IND, "[DL] [AM]" },
|
|
|
|
{ RLC_UM_DATA_REQ, "[UL] [UM]"},
|
|
|
|
{ RLC_UM_DATA_IND, "[DL] [UM]"},
|
|
|
|
{ RLC_TR_DATA_REQ, "[UL] [TM]"},
|
|
|
|
{ RLC_TR_DATA_IND, "[DL] [TM]"},
|
2009-01-23 15:58:33 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string rlc_logical_channel_vals[] = {
|
|
|
|
{ Channel_DCCH, "DCCH"},
|
|
|
|
{ Channel_BCCH, "BCCH"},
|
|
|
|
{ Channel_CCCH, "CCCH"},
|
|
|
|
{ Channel_PCCH, "PCCH"},
|
|
|
|
{ 0, NULL}
|
|
|
|
};
|
|
|
|
|
2009-01-02 01:37:55 +00:00
|
|
|
|
2009-12-29 22:57:10 +00:00
|
|
|
#define CCPRI_REQ 1
|
|
|
|
#define CCPRI_IND 2
|
|
|
|
|
|
|
|
static const value_string ccpri_opcode_vals[] = {
|
|
|
|
{ CCPRI_REQ, "REQUEST"},
|
|
|
|
{ CCPRI_IND, "INDICATION"},
|
|
|
|
{ 0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string ccpri_status_vals[] = {
|
|
|
|
{ 0, "OK"},
|
|
|
|
{ 1, "ERROR"},
|
|
|
|
{ 0, NULL}
|
|
|
|
};
|
|
|
|
|
2011-11-03 16:52:37 +00:00
|
|
|
static const value_string rlc_rbid_vals[] = {
|
|
|
|
{ 1, "DCH1"},
|
|
|
|
{ 2, "DCH2"},
|
|
|
|
{ 3, "DCH3"},
|
|
|
|
{ 4, "DCH4"},
|
|
|
|
{ 5, "DCH5"},
|
|
|
|
{ 6, "DCH6"},
|
|
|
|
{ 7, "DCH7"},
|
|
|
|
{ 8, "DCH8"},
|
|
|
|
{ 9, "DCH9"},
|
|
|
|
{ 10, "DCH10"},
|
|
|
|
{ 11, "DCH11"},
|
|
|
|
{ 12, "DCH12"},
|
|
|
|
{ 13, "DCH13"},
|
|
|
|
{ 14, "DCH14"},
|
|
|
|
{ 15, "DCH15"},
|
|
|
|
{ 17, "BCCH"},
|
|
|
|
{ 18, "CCCH"},
|
|
|
|
{ 19, "PCCH"},
|
|
|
|
{ 20, "SHCCH"},
|
|
|
|
{ 21, "CTCH"},
|
|
|
|
{ 23, "MCCH"},
|
|
|
|
{ 24, "MSCH"},
|
2011-11-04 13:41:12 +00:00
|
|
|
{ 25, "MTCH"},
|
|
|
|
{ 0, NULL}
|
2011-11-03 16:52:37 +00:00
|
|
|
};
|
2014-08-14 18:25:40 +00:00
|
|
|
static value_string_ext rlc_rbid_vals_ext = VALUE_STRING_EXT_INIT(rlc_rbid_vals);
|
2011-11-03 16:52:37 +00:00
|
|
|
|
2011-11-14 12:22:54 +00:00
|
|
|
static const value_string ueid_type_vals[] = {
|
|
|
|
{ 0, "URNTI"},
|
|
|
|
{ 1, "CRNTI"},
|
|
|
|
{ 0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string tx_priority_vals[] = {
|
|
|
|
{ 0, "Normal"},
|
|
|
|
{ 1, "High"},
|
|
|
|
{ 0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string transport_channel_type_vals[] = {
|
|
|
|
{ 1, "RACH"},
|
|
|
|
{ 2, "FACH"},
|
|
|
|
{ 3, "BCH"},
|
|
|
|
{ 4, "PCH"},
|
|
|
|
{ 6, "USCH"},
|
|
|
|
{ 7, "DSCH"},
|
|
|
|
{ 8, "DCH"},
|
|
|
|
{ 9, "HSDSCH"},
|
|
|
|
{ 10, "EDCH"},
|
|
|
|
{ 0, NULL}
|
|
|
|
};
|
|
|
|
|
2012-03-29 01:24:49 +00:00
|
|
|
#define LTE_NAS_RRC_DATA_IND 0x02
|
|
|
|
#define LTE_NAS_RRC_DATA_REQ 0x03
|
|
|
|
#define LTE_NAS_RRC_ESTABLISH_REQ 0x06
|
|
|
|
#define LTE_NAS_RRC_RELEASE_IND 0x08
|
|
|
|
|
|
|
|
static const value_string lte_nas_rrc_opcode_vals[] = {
|
|
|
|
{ LTE_NAS_RRC_DATA_IND, "Data-Ind"},
|
|
|
|
{ LTE_NAS_RRC_DATA_REQ, "Data-Req"},
|
|
|
|
{ LTE_NAS_RRC_ESTABLISH_REQ, "Establish-Req"},
|
|
|
|
{ LTE_NAS_RRC_RELEASE_IND, "Release-Ind"},
|
|
|
|
{ 0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-08-02 09:30:28 +00:00
|
|
|
|
2006-09-04 11:04:14 +00:00
|
|
|
#define MAX_OUTHDR_VALUES 32
|
|
|
|
|
|
|
|
extern int proto_fp;
|
2017-06-18 02:03:11 +00:00
|
|
|
extern int proto_umts_rlc;
|
2011-10-28 18:36:20 +00:00
|
|
|
|
2008-12-23 21:22:47 +00:00
|
|
|
extern int proto_rlc_lte;
|
2009-01-23 15:58:33 +00:00
|
|
|
extern int proto_pdcp_lte;
|
2006-09-04 11:04:14 +00:00
|
|
|
|
2009-04-18 08:03:09 +00:00
|
|
|
static dissector_handle_t mac_lte_handle;
|
|
|
|
static dissector_handle_t rlc_lte_handle;
|
|
|
|
static dissector_handle_t pdcp_lte_handle;
|
2016-12-17 01:06:11 +00:00
|
|
|
static dissector_handle_t catapult_dct2000_handle;
|
2009-04-18 08:03:09 +00:00
|
|
|
|
2011-01-12 02:25:08 +00:00
|
|
|
static dissector_handle_t look_for_dissector(const char *protocol_name);
|
2017-03-28 18:56:53 +00:00
|
|
|
static guint parse_outhdr_string(const guchar *outhdr_string, gint outhdr_length, guint *outhdr_values);
|
2011-10-28 18:36:20 +00:00
|
|
|
|
2006-10-25 16:46:27 +00:00
|
|
|
static void attach_fp_info(packet_info *pinfo, gboolean received,
|
2017-03-28 18:56:53 +00:00
|
|
|
const char *protocol_name, int variant,
|
|
|
|
guint *outhdr_values, guint outhdr_values_found);
|
2011-10-28 18:36:20 +00:00
|
|
|
static void attach_rlc_info(packet_info *pinfo, guint32 urnti, guint8 rbid,
|
2017-03-28 18:56:53 +00:00
|
|
|
gboolean is_sent, guint *outhdr_values,
|
|
|
|
guint outhdr_values_found);
|
2011-10-28 18:36:20 +00:00
|
|
|
|
2017-03-28 18:56:53 +00:00
|
|
|
static void attach_mac_lte_info(packet_info *pinfo, guint *outhdr_values,
|
|
|
|
guint outhdr_values_found);
|
|
|
|
static void attach_rlc_lte_info(packet_info *pinfo, guint *outhdr_values,
|
|
|
|
guint outhdr_values_found);
|
|
|
|
static void attach_pdcp_lte_info(packet_info *pinfo, guint *outhdr_values,
|
|
|
|
guint outhdr_values_found);
|
2008-12-23 21:22:47 +00:00
|
|
|
|
2006-09-04 11:04:14 +00:00
|
|
|
|
2006-08-02 09:30:28 +00:00
|
|
|
|
2007-07-12 17:31:26 +00:00
|
|
|
/* Return the number of bytes used to encode the length field
|
|
|
|
(we're not interested in the length value itself) */
|
|
|
|
static int skipASNLength(guint8 value)
|
|
|
|
{
|
|
|
|
if ((value & 0x80) == 0)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return ((value & 0x03) == 1) ? 2 : 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-05-23 05:48:00 +00:00
|
|
|
/* Look for the protocol data within an ipprim packet.
|
|
|
|
Only set *data_offset if data field found. */
|
2007-02-14 15:41:43 +00:00
|
|
|
static gboolean find_ipprim_data_offset(tvbuff_t *tvb, int *data_offset, guint8 direction,
|
2007-09-28 16:17:22 +00:00
|
|
|
guint32 *source_addr_offset, guint8 *source_addr_length,
|
|
|
|
guint32 *dest_addr_offset, guint8 *dest_addr_length,
|
2006-11-30 11:36:28 +00:00
|
|
|
guint32 *source_port_offset, guint32 *dest_port_offset,
|
2007-04-11 14:34:56 +00:00
|
|
|
port_type *type_of_port,
|
|
|
|
guint16 *conn_id_offset)
|
2006-05-23 05:48:00 +00:00
|
|
|
{
|
|
|
|
guint8 length;
|
2012-03-16 02:00:29 +00:00
|
|
|
int offset = *data_offset;
|
2006-05-23 05:48:00 +00:00
|
|
|
|
|
|
|
/* Get the ipprim command code. */
|
|
|
|
guint8 tag = tvb_get_guint8(tvb, offset++);
|
|
|
|
|
|
|
|
/* Only accept UDP or TCP data request or indication */
|
2009-07-13 10:55:53 +00:00
|
|
|
switch (tag) {
|
2006-05-23 05:48:00 +00:00
|
|
|
case 0x23: /* UDP data request */
|
|
|
|
case 0x24: /* UDP data indication */
|
2006-10-05 14:10:10 +00:00
|
|
|
*type_of_port = PT_UDP;
|
2006-05-23 05:48:00 +00:00
|
|
|
break;
|
|
|
|
case 0x45: /* TCP data request */
|
|
|
|
case 0x46: /* TCP data indication */
|
2006-10-05 14:10:10 +00:00
|
|
|
*type_of_port = PT_TCP;
|
2006-05-23 05:48:00 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Skip any other TLC fields before reach payload */
|
2015-04-16 11:31:57 +00:00
|
|
|
while (tvb_reported_length_remaining(tvb, offset) > 2) {
|
2006-05-23 05:48:00 +00:00
|
|
|
/* Look at next tag */
|
|
|
|
tag = tvb_get_guint8(tvb, offset++);
|
|
|
|
|
|
|
|
/* Is this the data payload we're expecting? */
|
2006-10-05 14:10:10 +00:00
|
|
|
if (((tag == 0x34) && (*type_of_port == PT_UDP)) ||
|
2009-07-13 10:55:53 +00:00
|
|
|
((tag == 0x48) && (*type_of_port == PT_TCP))) {
|
|
|
|
|
2006-05-23 05:48:00 +00:00
|
|
|
*data_offset = offset;
|
|
|
|
return TRUE;
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else {
|
2006-05-23 05:48:00 +00:00
|
|
|
/* Read length in next byte */
|
|
|
|
length = tvb_get_guint8(tvb, offset++);
|
2006-09-05 16:05:23 +00:00
|
|
|
|
2009-07-13 10:55:53 +00:00
|
|
|
if (tag == 0x31 && length >=4) {
|
2007-02-14 15:41:43 +00:00
|
|
|
/* Remote IP address */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (direction == 0) {
|
2007-02-14 15:41:43 +00:00
|
|
|
/* Sent *to* remote, so dest */
|
|
|
|
*dest_addr_offset = offset;
|
2007-09-28 16:17:22 +00:00
|
|
|
*dest_addr_length = (length/4) * 4;
|
2007-02-14 15:41:43 +00:00
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else {
|
2007-02-14 15:41:43 +00:00
|
|
|
*source_addr_offset = offset;
|
2007-09-28 16:17:22 +00:00
|
|
|
*source_addr_length = (length/4) * 4;
|
2007-02-14 15:41:43 +00:00
|
|
|
}
|
2006-09-05 16:05:23 +00:00
|
|
|
|
2007-02-14 15:41:43 +00:00
|
|
|
/* Remote port follows (if present) */
|
2009-07-13 10:55:53 +00:00
|
|
|
if ((length % 4) == 2) {
|
|
|
|
if (direction == 0) {
|
2010-08-18 10:47:21 +00:00
|
|
|
*dest_port_offset = offset + *dest_addr_length;
|
2007-02-14 15:41:43 +00:00
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else {
|
2010-08-18 10:47:21 +00:00
|
|
|
*source_port_offset = offset + *source_addr_length;
|
2007-02-14 15:41:43 +00:00
|
|
|
}
|
2006-09-05 16:05:23 +00:00
|
|
|
}
|
|
|
|
}
|
2007-04-11 14:34:56 +00:00
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (tag == 0x32) {
|
|
|
|
if (length == 4 || length == 16) {
|
2007-09-28 16:17:22 +00:00
|
|
|
/* Local IP address */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (direction == 0) {
|
2007-09-28 16:17:22 +00:00
|
|
|
/* Sent *from* local, so source */
|
|
|
|
*source_addr_offset = offset;
|
|
|
|
*source_addr_length = length;
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else {
|
2007-09-28 16:17:22 +00:00
|
|
|
*dest_addr_offset = offset;
|
|
|
|
*dest_addr_length = length;
|
|
|
|
}
|
2007-02-14 15:41:43 +00:00
|
|
|
}
|
2006-09-05 16:05:23 +00:00
|
|
|
}
|
2007-04-11 14:34:56 +00:00
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (tag == 0x33 && length == 2) {
|
2007-02-14 15:41:43 +00:00
|
|
|
/* Get local port */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (direction == 0) {
|
2007-02-14 15:41:43 +00:00
|
|
|
/* Sent from local, so source */
|
|
|
|
*source_port_offset = offset;
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else {
|
2007-02-14 15:41:43 +00:00
|
|
|
*dest_port_offset = offset;
|
|
|
|
}
|
2006-09-05 16:05:23 +00:00
|
|
|
}
|
2007-04-11 14:34:56 +00:00
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (tag == 0x36 && length == 2) {
|
2007-04-11 14:34:56 +00:00
|
|
|
/* Get conn_id */
|
|
|
|
*conn_id_offset = offset;
|
|
|
|
}
|
2006-09-05 16:05:23 +00:00
|
|
|
|
2007-04-11 14:34:56 +00:00
|
|
|
/* Skip the length of the indicated value */
|
2006-05-23 05:48:00 +00:00
|
|
|
offset += length;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* No data found... */
|
|
|
|
return FALSE;
|
|
|
|
}
|
2006-04-14 13:12:13 +00:00
|
|
|
|
2006-08-02 09:30:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Look for the protocol data within an sctpprim (variant 1 or 2...) packet.
|
|
|
|
Only set *data_offset if data field found. */
|
2008-01-16 14:19:45 +00:00
|
|
|
static gboolean find_sctpprim_variant1_data_offset(tvbuff_t *tvb, int *data_offset,
|
|
|
|
guint32 *dest_addr_offset,
|
2008-01-16 20:49:50 +00:00
|
|
|
guint16 *dest_addr_length,
|
2008-01-16 14:19:45 +00:00
|
|
|
guint32 *dest_port_offset)
|
2006-08-02 09:30:28 +00:00
|
|
|
{
|
|
|
|
int offset = *data_offset;
|
|
|
|
|
2008-01-16 14:19:45 +00:00
|
|
|
/* Get the sctpprim command code. */
|
2007-06-14 12:43:15 +00:00
|
|
|
guint8 first_tag = tvb_get_guint8(tvb, offset++);
|
|
|
|
guint8 tag;
|
2007-07-12 17:31:26 +00:00
|
|
|
guint8 first_length_byte;
|
2006-08-02 09:30:28 +00:00
|
|
|
|
|
|
|
/* Only accept interested in data requests or indications */
|
2009-07-13 10:55:53 +00:00
|
|
|
switch (first_tag) {
|
2007-06-14 12:43:15 +00:00
|
|
|
case 0x04: /* data request */
|
|
|
|
case 0x62: /* data indication */
|
2006-08-02 09:30:28 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2007-07-12 17:31:26 +00:00
|
|
|
first_length_byte = tvb_get_guint8(tvb, offset);
|
|
|
|
offset += skipASNLength(first_length_byte);
|
2006-08-02 09:30:28 +00:00
|
|
|
|
2006-10-23 17:22:20 +00:00
|
|
|
/* Skip any other fields before reach payload */
|
2015-04-16 11:31:57 +00:00
|
|
|
while (tvb_reported_length_remaining(tvb, offset) > 2) {
|
2006-08-02 09:30:28 +00:00
|
|
|
/* Look at next tag */
|
2007-06-14 12:43:15 +00:00
|
|
|
tag = tvb_get_guint8(tvb, offset++);
|
|
|
|
|
2006-08-02 09:30:28 +00:00
|
|
|
/* Is this the data payload we're expecting? */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (tag == 0x19) {
|
2006-08-02 09:30:28 +00:00
|
|
|
*data_offset = offset;
|
|
|
|
return TRUE;
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else {
|
2007-07-12 17:31:26 +00:00
|
|
|
/* Skip length field */
|
|
|
|
offset++;
|
2009-07-13 10:55:53 +00:00
|
|
|
switch (tag) {
|
2007-07-12 17:31:26 +00:00
|
|
|
case 0x0a: /* destPort */
|
2008-01-16 14:19:45 +00:00
|
|
|
*dest_port_offset = offset;
|
|
|
|
offset += 2;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x01: /* sctpInstanceNum */
|
2007-07-12 17:31:26 +00:00
|
|
|
case 0x1e: /* strseqnum */
|
|
|
|
case 0x0d: /* streamnum */
|
|
|
|
offset += 2;
|
|
|
|
continue;
|
2008-01-16 14:19:45 +00:00
|
|
|
|
2007-07-12 17:31:26 +00:00
|
|
|
case 0x09: /* ipv4Address */
|
2008-01-16 14:19:45 +00:00
|
|
|
*dest_addr_offset = offset;
|
|
|
|
*dest_addr_length = 4;
|
|
|
|
offset += 4;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x1d:
|
2007-07-12 17:31:26 +00:00
|
|
|
case 0x0c: /* payloadType */
|
|
|
|
offset += 4;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* Fail if not a known header field */
|
|
|
|
return FALSE;
|
2006-10-23 17:22:20 +00:00
|
|
|
}
|
2006-08-02 09:30:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* No data found... */
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Look for the protocol data within an sctpprim (variant 3) packet.
|
2015-11-08 15:07:10 +00:00
|
|
|
Return value indicates whether this header found.
|
2006-08-02 09:30:28 +00:00
|
|
|
Only set *data_offset if data field found. */
|
2008-01-16 14:19:45 +00:00
|
|
|
static gboolean find_sctpprim_variant3_data_offset(tvbuff_t *tvb, int *data_offset,
|
|
|
|
guint32 *dest_addr_offset,
|
2008-01-16 20:49:50 +00:00
|
|
|
guint16 *dest_addr_length,
|
2008-01-16 14:19:45 +00:00
|
|
|
guint32 *dest_port_offset)
|
2006-08-02 09:30:28 +00:00
|
|
|
{
|
2012-03-16 02:00:29 +00:00
|
|
|
guint16 tag = 0;
|
2008-01-16 14:19:45 +00:00
|
|
|
guint16 length = 0;
|
2012-03-16 02:00:29 +00:00
|
|
|
int offset = *data_offset;
|
2006-08-02 09:30:28 +00:00
|
|
|
|
|
|
|
/* Get the sctpprim (2 byte) command code. */
|
2007-06-14 12:43:15 +00:00
|
|
|
guint16 top_tag = tvb_get_ntohs(tvb, offset);
|
2006-08-02 09:30:28 +00:00
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* Only interested in data requests or indications */
|
2015-11-08 16:30:54 +00:00
|
|
|
if ((top_tag != 0x0400) && /* SendDataReq */
|
|
|
|
(top_tag != 0x6200)) { /* DataInd */
|
|
|
|
return FALSE;
|
2006-08-02 09:30:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Overall length field is next 2 bytes */
|
|
|
|
offset += 2;
|
|
|
|
|
2008-01-16 14:19:45 +00:00
|
|
|
/* Rx/Tx ops have different formats */
|
|
|
|
|
|
|
|
/*****************/
|
|
|
|
/* DataInd */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (top_tag == 0x6200) {
|
2008-01-16 14:19:45 +00:00
|
|
|
/* Next 2 bytes are associate ID */
|
|
|
|
offset += 2;
|
2006-08-02 09:30:28 +00:00
|
|
|
|
2008-01-16 14:19:45 +00:00
|
|
|
/* Next 2 bytes are destination port */
|
|
|
|
*dest_port_offset = offset;
|
2006-08-02 09:30:28 +00:00
|
|
|
offset += 2;
|
|
|
|
|
2008-01-16 14:19:45 +00:00
|
|
|
/* Destination address should follow - check tag */
|
|
|
|
tag = tvb_get_ntohs(tvb, offset);
|
2009-07-13 10:55:53 +00:00
|
|
|
if (tag != 0x0900) {
|
2008-01-16 14:19:45 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* Skip tag */
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* Length field */
|
|
|
|
length = tvb_get_ntohs(tvb, offset) / 2;
|
|
|
|
if ((length != 4) && (length != 16))
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* Address data is here */
|
|
|
|
*dest_addr_offset = offset;
|
|
|
|
*dest_addr_length = length;
|
|
|
|
|
|
|
|
offset += length;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Not interested in remaining (fixed) fields */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (tvb_reported_length_remaining(tvb, offset) > (4 + 2 + 2 + 4)) {
|
2008-01-16 14:19:45 +00:00
|
|
|
offset += (4 + 2 + 2 + 4);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Data should now be here */
|
|
|
|
tag = tvb_get_ntohs(tvb, offset);
|
|
|
|
offset += 2;
|
2009-07-13 10:55:53 +00:00
|
|
|
if (tag == 0x1900) {
|
2006-08-02 09:30:28 +00:00
|
|
|
/* 2-byte length field */
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* Data is here!!! */
|
|
|
|
*data_offset = offset;
|
|
|
|
return TRUE;
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else {
|
2008-01-16 14:19:45 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
2006-08-02 09:30:28 +00:00
|
|
|
|
2015-11-08 15:07:10 +00:00
|
|
|
/***********************************/
|
|
|
|
/* SendDataReq (top_tag == 0x0400) */
|
|
|
|
else {
|
2008-01-16 14:19:45 +00:00
|
|
|
/* AssociateId should follow - check tag */
|
|
|
|
tag = tvb_get_ntohs(tvb, offset);
|
2009-07-13 10:55:53 +00:00
|
|
|
if (tag != 0x2400) {
|
2008-01-16 14:19:45 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* Skip tag */
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* Skip 2-byte value */
|
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get tag */
|
|
|
|
tag = tvb_get_ntohs(tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* Some optional params */
|
2015-04-16 11:31:57 +00:00
|
|
|
while ((tag != 0x0c00) && (tvb_reported_length_remaining(tvb, offset) > 4)) {
|
2009-07-13 10:55:53 +00:00
|
|
|
switch (tag) {
|
2008-01-16 14:19:45 +00:00
|
|
|
case 0x0900: /* Dest address */
|
|
|
|
/* Length field */
|
|
|
|
length = tvb_get_ntohs(tvb, offset) / 2;
|
2009-07-13 10:55:53 +00:00
|
|
|
if ((length != 4) && (length != 16)) {
|
2008-01-16 14:19:45 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2006-08-02 09:30:28 +00:00
|
|
|
offset += 2;
|
2008-01-16 14:19:45 +00:00
|
|
|
|
|
|
|
/* Address data is here */
|
|
|
|
*dest_addr_offset = offset;
|
|
|
|
*dest_addr_length = length;
|
|
|
|
|
|
|
|
offset += length;
|
2006-08-02 09:30:28 +00:00
|
|
|
break;
|
|
|
|
|
2008-01-16 14:19:45 +00:00
|
|
|
case 0x0a00: /* Dest port number */
|
|
|
|
*dest_port_offset = offset;
|
|
|
|
offset += 2;
|
2006-08-02 09:30:28 +00:00
|
|
|
break;
|
|
|
|
|
2008-01-16 14:19:45 +00:00
|
|
|
case 0x0d00: /* StreamNum */
|
|
|
|
*dest_port_offset = offset;
|
|
|
|
offset += 2;
|
2006-08-02 09:30:28 +00:00
|
|
|
break;
|
|
|
|
|
2008-01-16 14:19:45 +00:00
|
|
|
|
2006-08-02 09:30:28 +00:00
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2008-01-16 14:19:45 +00:00
|
|
|
/* Get the next tag */
|
|
|
|
tag = tvb_get_ntohs(tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Mandatory payload type */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (tag != 0x0c00) {
|
2008-01-16 14:19:45 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
length = tvb_get_ntohs(tvb, offset) / 2;
|
|
|
|
offset += 2;
|
|
|
|
offset += length;
|
|
|
|
|
|
|
|
|
|
|
|
/* Optional options */
|
|
|
|
tag = tvb_get_ntohs(tvb, offset);
|
|
|
|
offset += 2;
|
2009-07-13 10:55:53 +00:00
|
|
|
if (tag == 0x0b00) {
|
2008-01-16 14:19:45 +00:00
|
|
|
length = tvb_get_ntohs(tvb, offset) / 2;
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
offset += length;
|
|
|
|
|
|
|
|
/* Get next tag */
|
|
|
|
tag = tvb_get_ntohs(tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Data should now be here!! */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (tag == 0x1900) {
|
2008-01-16 14:19:45 +00:00
|
|
|
/* 2-byte length field */
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* Data is here!!! */
|
|
|
|
*data_offset = offset;
|
|
|
|
return TRUE;
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else {
|
2008-01-16 14:19:45 +00:00
|
|
|
return FALSE;
|
2006-08-02 09:30:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-10-28 18:36:20 +00:00
|
|
|
/* Dissect a UMTS RLC frame by:
|
|
|
|
- parsing the primitive header
|
|
|
|
- passing those values + outhdeader to dissector
|
|
|
|
- calling the UMTS RLC dissector */
|
|
|
|
static void dissect_rlc_umts(tvbuff_t *tvb, gint offset,
|
|
|
|
packet_info *pinfo, proto_tree *tree,
|
2017-03-28 18:56:53 +00:00
|
|
|
gboolean is_sent, guint *outhdr_values,
|
|
|
|
guint outhdr_values_found)
|
2011-10-28 18:36:20 +00:00
|
|
|
{
|
2012-03-16 02:00:29 +00:00
|
|
|
guint8 tag;
|
|
|
|
gboolean ueid_set = FALSE, rbid_set=FALSE;
|
|
|
|
guint32 ueid = 0;
|
|
|
|
guint8 rbid = 0;
|
|
|
|
guint8 length;
|
|
|
|
tvbuff_t *rlc_tvb;
|
|
|
|
dissector_handle_t rlc_umts_handle = 0;
|
2011-10-28 18:36:20 +00:00
|
|
|
|
|
|
|
/* Top-level opcode */
|
|
|
|
tag = tvb_get_guint8(tvb, offset++);
|
|
|
|
switch (tag) {
|
|
|
|
case 0xc0: /* mac data request */
|
|
|
|
case 0xc1: /* mac data indication */
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* No data to dissect */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Keep going until reach data tag or end of frame */
|
2015-04-16 11:31:57 +00:00
|
|
|
while ((tag != 0x41) && tvb_reported_length_remaining(tvb, offset)) { /* i.e. Data */
|
2011-10-28 18:36:20 +00:00
|
|
|
tag = tvb_get_guint8(tvb, offset++);
|
|
|
|
switch (tag) {
|
|
|
|
case 0x72: /* UE Id */
|
|
|
|
ueid = tvb_get_ntohl(tvb, offset);
|
2011-11-03 16:52:37 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_ueid, tvb, offset, 4, ENC_BIG_ENDIAN);
|
2011-10-28 18:36:20 +00:00
|
|
|
offset += 4;
|
|
|
|
ueid_set = TRUE;
|
|
|
|
break;
|
|
|
|
case 0xa2: /* RBID */
|
|
|
|
offset++; /* skip length */
|
|
|
|
rbid = tvb_get_guint8(tvb, offset);
|
2011-11-03 16:52:37 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_rbid, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2011-10-28 18:36:20 +00:00
|
|
|
offset++;
|
|
|
|
rbid_set = TRUE;
|
|
|
|
break;
|
|
|
|
case 0x22: /* CCCH-id setting rbid to CCCH! */
|
2011-11-03 16:52:37 +00:00
|
|
|
offset++; /* skip length */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_ccch_id, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
offset++;
|
2011-10-28 18:36:20 +00:00
|
|
|
rbid = 18;
|
|
|
|
break;
|
|
|
|
case 0xc4: /* No CRC error */
|
2011-11-03 16:52:37 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_no_crc_error, tvb, offset-1, 1, ENC_NA);
|
|
|
|
break;
|
2011-10-28 18:36:20 +00:00
|
|
|
case 0xc5: /* CRC error */
|
2011-11-03 16:52:37 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_crc_error, tvb, offset-1, 1, ENC_NA);
|
|
|
|
break;
|
2011-10-28 18:36:20 +00:00
|
|
|
case 0xf7: /* Clear Tx Buffer */
|
2011-11-03 16:52:37 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_clear_tx_buffer, tvb, offset-1, 1, ENC_NA);
|
2011-10-28 18:36:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x41: /* Data !!! */
|
|
|
|
offset += skipASNLength(tvb_get_guint8(tvb, offset));
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* For other fields, just skip length and following data */
|
|
|
|
length = tvb_get_guint8(tvb, offset++);
|
2011-11-14 12:22:54 +00:00
|
|
|
switch (tag) {
|
|
|
|
case 0x42: /* Buffer Occupancy */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_buffer_occupancy, tvb, offset, length, ENC_BIG_ENDIAN);
|
|
|
|
break;
|
|
|
|
case 0x49: /* PDU Size */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_pdu_size, tvb, offset, 2, ENC_LITTLE_ENDIAN);
|
|
|
|
break;
|
|
|
|
case 0x47: /* UEId type */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_ueid_type, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
break;
|
|
|
|
case 0x4e: /* Tx Priority */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_tx_priority, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
break;
|
|
|
|
case 0x4c: /* Last in seg set */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_last_in_seg_set, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
break;
|
|
|
|
case 0x43: /* Rx timing deviation */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_rx_timing_deviation, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
break;
|
|
|
|
case 0x46: /* Transport channel type */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_transport_channel_type, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
break;
|
|
|
|
case 0xc2: /* Number of padding bits */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_no_padding_bits, tvb, offset, 1, ENC_BIG_ENDIAN);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2011-10-28 18:36:20 +00:00
|
|
|
offset += length;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Have we got enough info to call dissector */
|
|
|
|
if ((tag == 0x41) && ueid_set && rbid_set) {
|
2017-03-28 18:56:53 +00:00
|
|
|
attach_rlc_info(pinfo, ueid, rbid, is_sent, outhdr_values,
|
|
|
|
outhdr_values_found);
|
2011-10-28 18:36:20 +00:00
|
|
|
|
|
|
|
/* Set appropriate RLC dissector handle */
|
|
|
|
switch (rbid) {
|
|
|
|
case 1: case 2: case 3: case 4: case 5:
|
|
|
|
case 6: case 7: case 8: case 9: case 10:
|
|
|
|
case 11: case 12: case 13: case 14: case 15:
|
2011-11-15 12:03:52 +00:00
|
|
|
/* DCH channels. */
|
|
|
|
/* TODO: can't really tell if these are control or transport...
|
|
|
|
maybe control with preferences (UAT?) between "rlc.ps_dtch" and "rlc.dcch" ? */
|
|
|
|
rlc_umts_handle = find_dissector("rlc.dch_unknown");
|
2011-10-28 18:36:20 +00:00
|
|
|
break;
|
|
|
|
case 18:
|
|
|
|
rlc_umts_handle = find_dissector("rlc.ccch");
|
|
|
|
break;
|
|
|
|
case 21:
|
|
|
|
rlc_umts_handle = find_dissector("rlc.ctch");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* Give up here */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Call UMTS RLC dissector */
|
|
|
|
if (rlc_umts_handle != 0) {
|
2013-02-19 23:17:07 +00:00
|
|
|
rlc_tvb = tvb_new_subset_remaining(tvb, offset);
|
2012-09-11 08:28:07 +00:00
|
|
|
call_dissector_only(rlc_umts_handle, rlc_tvb, pinfo, tree, NULL);
|
2011-10-28 18:36:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-23 15:58:33 +00:00
|
|
|
|
2009-01-02 01:37:55 +00:00
|
|
|
|
|
|
|
/* Dissect an RRC LTE frame by first parsing the header entries then passing
|
2009-05-13 09:36:42 +00:00
|
|
|
the data to the RRC dissector, according to direction and channel type.
|
|
|
|
TODO: factor out common code between this function and dissect_pdcp_lte() */
|
2009-05-26 16:01:12 +00:00
|
|
|
static void dissect_rrc_lte(tvbuff_t *tvb, gint offset,
|
2009-07-07 14:38:14 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree)
|
2009-01-02 01:37:55 +00:00
|
|
|
{
|
2012-03-16 02:00:29 +00:00
|
|
|
guint8 tag;
|
|
|
|
dissector_handle_t protocol_handle = 0;
|
|
|
|
gboolean isUplink = FALSE;
|
|
|
|
LogicalChannelType logicalChannelType;
|
|
|
|
guint16 cell_id;
|
|
|
|
guint8 bcch_transport = 0;
|
|
|
|
tvbuff_t *rrc_tvb;
|
2009-01-02 01:37:55 +00:00
|
|
|
|
2009-01-23 15:58:33 +00:00
|
|
|
/* Top-level opcode */
|
2009-01-02 01:37:55 +00:00
|
|
|
tag = tvb_get_guint8(tvb, offset++);
|
|
|
|
switch (tag) {
|
|
|
|
case 0x00: /* Data_Req_UE */
|
|
|
|
case 0x04: /* Data_Ind_eNodeB */
|
|
|
|
isUplink = TRUE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x02: /* Data_Req_eNodeB */
|
|
|
|
case 0x03: /* Data_Ind_UE */
|
|
|
|
isUplink = FALSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* Unexpected opcode tag! */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Skip length */
|
|
|
|
offset += skipASNLength(tvb_get_guint8(tvb, offset));
|
|
|
|
|
|
|
|
/* Get next tag */
|
|
|
|
tag = tvb_get_guint8(tvb, offset++);
|
|
|
|
switch (tag) {
|
|
|
|
case 0x12: /* UE_Id_LCId */
|
2009-01-23 15:58:33 +00:00
|
|
|
|
|
|
|
/* Dedicated channel info */
|
|
|
|
|
2009-01-02 01:37:55 +00:00
|
|
|
/* Length will fit in one byte here */
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
logicalChannelType = Channel_DCCH;
|
|
|
|
|
|
|
|
/* UEId */
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_ueid, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-01-02 01:37:55 +00:00
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* Get tag of channel type */
|
|
|
|
tag = tvb_get_guint8(tvb, offset++);
|
|
|
|
|
|
|
|
switch (tag) {
|
|
|
|
case 0:
|
|
|
|
offset++;
|
2009-07-13 10:55:53 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " SRB:%u",
|
|
|
|
tvb_get_guint8(tvb, offset));
|
2009-01-02 01:37:55 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_srbid,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
2010-11-28 15:37:40 +00:00
|
|
|
offset++;
|
2009-01-02 01:37:55 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
offset++;
|
2009-07-13 10:55:53 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " DRB:%u",
|
|
|
|
tvb_get_guint8(tvb, offset));
|
2009-01-02 01:37:55 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_drbid,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
2010-11-28 15:37:40 +00:00
|
|
|
offset++;
|
2009-01-02 01:37:55 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* Unexpected channel type */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x1a: /* Cell_LCId */
|
|
|
|
|
2009-01-23 15:58:33 +00:00
|
|
|
/* Common channel info */
|
|
|
|
|
2009-01-02 01:37:55 +00:00
|
|
|
/* Skip length */
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* Cell-id */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_cellid,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
2010-12-21 17:46:25 +00:00
|
|
|
cell_id = tvb_get_ntohs(tvb, offset);
|
2009-01-02 01:37:55 +00:00
|
|
|
offset += 2;
|
|
|
|
|
2009-01-23 15:58:33 +00:00
|
|
|
/* Logical channel type */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_rlc_channel_type,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
2010-12-21 17:46:25 +00:00
|
|
|
logicalChannelType = (LogicalChannelType)tvb_get_guint8(tvb, offset);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* Won't be seen if RRC decoder is called... */
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " cell-id=%u %s",
|
|
|
|
cell_id,
|
2010-03-14 17:56:37 +00:00
|
|
|
val_to_str_const(logicalChannelType, rlc_logical_channel_vals,
|
|
|
|
"UNKNOWN-CHANNEL"));
|
2009-01-23 15:58:33 +00:00
|
|
|
|
2010-12-21 17:46:25 +00:00
|
|
|
|
2009-01-02 01:37:55 +00:00
|
|
|
switch (logicalChannelType) {
|
|
|
|
case Channel_BCCH:
|
|
|
|
/* Skip length */
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* Transport channel type */
|
|
|
|
bcch_transport = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_bcch_transport,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-01-02 01:37:55 +00:00
|
|
|
offset++;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Channel_CCCH:
|
|
|
|
/* Skip length */
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* UEId */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_ueid,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-01-02 01:37:55 +00:00
|
|
|
offset += 2;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* Unexpected tag */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Data tag should follow */
|
|
|
|
tag = tvb_get_guint8(tvb, offset++);
|
|
|
|
if (tag != 0xaa) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Skip length */
|
|
|
|
offset += skipASNLength(tvb_get_guint8(tvb, offset));
|
|
|
|
|
|
|
|
/* Look up dissector handle corresponding to direction and channel type */
|
|
|
|
if (isUplink) {
|
|
|
|
|
|
|
|
/* Uplink channel types */
|
|
|
|
switch (logicalChannelType) {
|
|
|
|
case Channel_DCCH:
|
2010-11-28 15:37:40 +00:00
|
|
|
protocol_handle = find_dissector("lte_rrc.ul_dcch");
|
2009-01-02 01:37:55 +00:00
|
|
|
break;
|
|
|
|
case Channel_CCCH:
|
2010-11-28 15:37:40 +00:00
|
|
|
protocol_handle = find_dissector("lte_rrc.ul_ccch");
|
2009-01-02 01:37:55 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* Unknown Uplink channel type */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
|
|
|
|
/* Downlink channel types */
|
|
|
|
switch (logicalChannelType) {
|
|
|
|
case Channel_DCCH:
|
2010-11-28 15:37:40 +00:00
|
|
|
protocol_handle = find_dissector("lte_rrc.dl_dcch");
|
2009-01-02 01:37:55 +00:00
|
|
|
break;
|
|
|
|
case Channel_CCCH:
|
2010-11-28 15:37:40 +00:00
|
|
|
protocol_handle = find_dissector("lte_rrc.dl_ccch");
|
2009-01-02 01:37:55 +00:00
|
|
|
break;
|
|
|
|
case Channel_PCCH:
|
2012-09-23 21:01:05 +00:00
|
|
|
protocol_handle = find_dissector("lte_rrc.pcch");
|
2009-01-02 01:37:55 +00:00
|
|
|
break;
|
|
|
|
case Channel_BCCH:
|
|
|
|
if (bcch_transport == 1) {
|
2012-09-23 21:01:05 +00:00
|
|
|
protocol_handle = find_dissector("lte_rrc.bcch_bch");
|
2009-01-02 01:37:55 +00:00
|
|
|
}
|
|
|
|
else {
|
2012-09-23 21:01:05 +00:00
|
|
|
protocol_handle = find_dissector("lte_rrc.bcch_dl_sch");
|
2009-01-02 01:37:55 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* Unknown Downlink channel type */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Send to RRC dissector, if got here, have sub-dissector and some data left */
|
2015-04-16 11:31:57 +00:00
|
|
|
if ((protocol_handle != NULL) && (tvb_reported_length_remaining(tvb, offset) > 0)) {
|
2013-02-19 23:17:07 +00:00
|
|
|
rrc_tvb = tvb_new_subset_remaining(tvb, offset);
|
2012-09-11 08:28:07 +00:00
|
|
|
call_dissector_only(protocol_handle, rrc_tvb, pinfo, tree, NULL);
|
2009-01-02 01:37:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-12-29 22:57:10 +00:00
|
|
|
/* Dissect an CCPRI LTE frame by first parsing the header entries then passing
|
2016-08-25 02:23:09 +00:00
|
|
|
the data to the CPRI C&M dissector
|
|
|
|
|
|
|
|
XXX - is this the Common Public Radio Interface? If so, what's the extra
|
|
|
|
"C" in "CCPRI"? And why is the LAPB dissector involved here? The CPRI
|
|
|
|
spec just speaks of HDLC; LAPB is certainly a HDLC-based protocol, but
|
|
|
|
that doesn't mean every HDLC-based protocol is LAPB. */
|
2009-12-29 22:57:10 +00:00
|
|
|
static void dissect_ccpri_lte(tvbuff_t *tvb, gint offset,
|
|
|
|
packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
2012-03-16 02:00:29 +00:00
|
|
|
guint8 opcode;
|
|
|
|
guint8 tag;
|
|
|
|
tvbuff_t *ccpri_tvb;
|
|
|
|
dissector_handle_t protocol_handle = 0;
|
|
|
|
guint16 length;
|
2009-12-29 22:57:10 +00:00
|
|
|
|
|
|
|
/* Top-level opcode */
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_ccpri_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-12-29 22:57:10 +00:00
|
|
|
opcode = tvb_get_guint8(tvb, offset++);
|
|
|
|
|
|
|
|
/* Skip 2-byte length field */
|
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* Cell-id */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_cellid,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-12-29 22:57:10 +00:00
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* Status (ind only) */
|
|
|
|
if (opcode == 2) {
|
|
|
|
proto_item *ti;
|
|
|
|
guint8 status = tvb_get_guint8(tvb, offset);
|
|
|
|
ti = proto_tree_add_item(tree, hf_catapult_dct2000_lte_ccpri_status,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-12-29 22:57:10 +00:00
|
|
|
offset++;
|
|
|
|
|
|
|
|
if (status != 0) {
|
2013-05-25 17:06:40 +00:00
|
|
|
expert_add_info(pinfo, ti, &ei_catapult_dct2000_lte_ccpri_status_error);
|
2009-12-29 22:57:10 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Channel ID */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_ccpri_channel,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-12-29 22:57:10 +00:00
|
|
|
offset++;
|
|
|
|
|
2011-01-05 14:45:31 +00:00
|
|
|
/* Data tag must follow */
|
2009-12-29 22:57:10 +00:00
|
|
|
tag = tvb_get_guint8(tvb, offset++);
|
|
|
|
if (tag != 2) {
|
2011-01-05 14:45:31 +00:00
|
|
|
return;
|
2009-12-29 22:57:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Skip length */
|
|
|
|
length = tvb_get_ntohs(tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
|
2016-08-25 02:23:09 +00:00
|
|
|
/* Send remainder to lapb dissector; I assume "CPRI" is the Common
|
|
|
|
Public Radio Interface, in which case the "lapb" dissector is
|
|
|
|
being used to dissect the HDLC used by CPRI, and in which case
|
|
|
|
we should really have a CPRI dissector that dissects its HDLC
|
|
|
|
and then hands off to a CPRI C&M dissector. */
|
2009-12-29 22:57:10 +00:00
|
|
|
protocol_handle = find_dissector("lapb");
|
2015-04-16 11:31:57 +00:00
|
|
|
if ((protocol_handle != NULL) && (tvb_reported_length_remaining(tvb, offset) > 0)) {
|
2014-06-06 14:35:50 +00:00
|
|
|
ccpri_tvb = tvb_new_subset_length(tvb, offset, length);
|
2012-09-11 08:28:07 +00:00
|
|
|
call_dissector_only(protocol_handle, ccpri_tvb, pinfo, tree, NULL);
|
2009-12-29 22:57:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-05-11 15:19:51 +00:00
|
|
|
/* Dissect a PDCP LTE frame by first parsing the RLCPrim header then passing
|
2009-01-23 15:58:33 +00:00
|
|
|
the data to the PDCP LTE dissector */
|
2009-05-26 16:01:12 +00:00
|
|
|
static void dissect_pdcp_lte(tvbuff_t *tvb, gint offset,
|
2009-09-14 10:26:53 +00:00
|
|
|
packet_info *pinfo, proto_tree *tree)
|
2009-01-23 15:58:33 +00:00
|
|
|
{
|
2012-03-16 02:00:29 +00:00
|
|
|
guint8 opcode;
|
|
|
|
guint8 tag;
|
|
|
|
struct pdcp_lte_info *p_pdcp_lte_info = NULL;
|
|
|
|
tvbuff_t *pdcp_lte_tvb;
|
|
|
|
guint16 ueid;
|
|
|
|
guint8 channelId;
|
2009-05-11 15:19:51 +00:00
|
|
|
|
|
|
|
/* Look this up so can update channel info */
|
2013-11-23 02:20:13 +00:00
|
|
|
p_pdcp_lte_info = (struct pdcp_lte_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_pdcp_lte, 0);
|
2009-05-11 15:19:51 +00:00
|
|
|
if (p_pdcp_lte_info == NULL) {
|
|
|
|
/* This really should be set...can't dissect anything without it */
|
|
|
|
return;
|
|
|
|
}
|
2009-01-23 15:58:33 +00:00
|
|
|
|
|
|
|
/* Top-level opcode */
|
|
|
|
opcode = tvb_get_guint8(tvb, offset);
|
|
|
|
if (tree) {
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_rlc_op, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-01-23 15:58:33 +00:00
|
|
|
}
|
|
|
|
offset++;
|
|
|
|
|
2009-09-06 04:26:50 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(opcode, rlc_op_vals, "Unknown"));
|
2009-01-23 15:58:33 +00:00
|
|
|
|
2009-05-11 15:19:51 +00:00
|
|
|
/* Assume UE side, so REQ is UL, IND is DL */
|
|
|
|
switch (opcode) {
|
|
|
|
case RLC_AM_DATA_REQ:
|
|
|
|
case RLC_UM_DATA_REQ:
|
|
|
|
case RLC_TR_DATA_REQ:
|
2009-05-13 09:36:42 +00:00
|
|
|
p_pdcp_lte_info->direction = DIRECTION_UPLINK;
|
2010-12-20 11:26:50 +00:00
|
|
|
break;
|
2009-05-11 15:19:51 +00:00
|
|
|
|
|
|
|
default:
|
2009-05-13 09:36:42 +00:00
|
|
|
p_pdcp_lte_info->direction = DIRECTION_DOWNLINK;
|
2009-05-11 15:19:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Parse header */
|
2009-01-23 15:58:33 +00:00
|
|
|
switch (opcode) {
|
|
|
|
case RLC_AM_DATA_REQ:
|
|
|
|
case RLC_AM_DATA_IND:
|
|
|
|
case RLC_UM_DATA_REQ:
|
|
|
|
case RLC_UM_DATA_IND:
|
|
|
|
case RLC_TR_DATA_REQ:
|
|
|
|
case RLC_TR_DATA_IND:
|
|
|
|
|
|
|
|
/* Get next tag */
|
|
|
|
tag = tvb_get_guint8(tvb, offset++);
|
|
|
|
switch (tag) {
|
|
|
|
case 0x10: /* UE_Id_LCId */
|
|
|
|
|
|
|
|
/* Dedicated channel info */
|
|
|
|
|
|
|
|
/* Length will fit in one byte here */
|
|
|
|
offset++;
|
|
|
|
|
2009-05-11 15:19:51 +00:00
|
|
|
p_pdcp_lte_info->channelType = Channel_DCCH;
|
2009-01-23 15:58:33 +00:00
|
|
|
|
|
|
|
/* UEId */
|
2010-11-05 18:00:35 +00:00
|
|
|
ueid = tvb_get_ntohs(tvb, offset);
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_ueid, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-07-13 10:55:53 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO,
|
2010-11-05 18:00:35 +00:00
|
|
|
" UEId=%u", ueid);
|
|
|
|
p_pdcp_lte_info->ueid = ueid;
|
2009-01-23 15:58:33 +00:00
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* Get tag of channel type */
|
|
|
|
tag = tvb_get_guint8(tvb, offset++);
|
|
|
|
|
|
|
|
switch (tag) {
|
|
|
|
case 0:
|
|
|
|
offset++;
|
2010-11-05 18:00:35 +00:00
|
|
|
channelId = tvb_get_guint8(tvb, offset);
|
2009-07-13 10:55:53 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " SRB:%u",
|
2010-11-05 18:00:35 +00:00
|
|
|
channelId);
|
2009-01-23 15:58:33 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_srbid,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset++, 1, ENC_BIG_ENDIAN);
|
2010-11-05 18:00:35 +00:00
|
|
|
p_pdcp_lte_info->channelId = channelId;
|
2009-01-23 15:58:33 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
offset++;
|
2010-11-05 18:00:35 +00:00
|
|
|
channelId = tvb_get_guint8(tvb, offset);
|
2009-07-13 10:55:53 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " DRB:%u",
|
2010-11-05 18:00:35 +00:00
|
|
|
channelId);
|
2009-01-23 15:58:33 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_drbid,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset++, 1, ENC_BIG_ENDIAN);
|
2010-11-05 18:00:35 +00:00
|
|
|
p_pdcp_lte_info->channelId = channelId;
|
2009-01-23 15:58:33 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* Unexpected channel type */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0x1a: /* Cell_LCId */
|
|
|
|
|
|
|
|
/* Common channel info */
|
|
|
|
|
|
|
|
/* Skip length */
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* Cell-id */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_cellid,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-01-23 15:58:33 +00:00
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* Logical channel type */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_rlc_channel_type,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
2013-03-14 22:10:59 +00:00
|
|
|
p_pdcp_lte_info->channelType = (LogicalChannelType)tvb_get_guint8(tvb, offset++);
|
2009-07-13 10:55:53 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
|
2010-03-14 17:56:37 +00:00
|
|
|
val_to_str_const(p_pdcp_lte_info->channelType, rlc_logical_channel_vals,
|
|
|
|
"UNKNOWN-CHANNEL"));
|
2009-01-23 15:58:33 +00:00
|
|
|
|
2009-05-11 15:19:51 +00:00
|
|
|
switch (p_pdcp_lte_info->channelType) {
|
2009-01-23 15:58:33 +00:00
|
|
|
case Channel_BCCH:
|
|
|
|
/* Skip length */
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* Transport channel type */
|
2013-03-14 22:10:59 +00:00
|
|
|
p_pdcp_lte_info->BCCHTransport = (BCCHTransportType)tvb_get_guint8(tvb, offset);
|
2009-01-23 15:58:33 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_bcch_transport,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-01-23 15:58:33 +00:00
|
|
|
offset++;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Channel_CCCH:
|
|
|
|
/* Skip length */
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* UEId */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_ueid,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-09-14 10:26:53 +00:00
|
|
|
ueid = tvb_get_ntohs(tvb, offset);
|
2009-01-23 15:58:33 +00:00
|
|
|
offset += 2;
|
2009-09-14 10:26:53 +00:00
|
|
|
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " UEId=%u", ueid);
|
2009-01-23 15:58:33 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* Unexpected tag */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Other optional fields may follow */
|
|
|
|
tag = tvb_get_guint8(tvb, offset++);
|
2015-04-16 11:31:57 +00:00
|
|
|
while ((tag != 0x41) && (tvb_reported_length_remaining(tvb, offset) > 2)) {
|
2009-01-23 15:58:33 +00:00
|
|
|
|
|
|
|
if (tag == 0x35) {
|
|
|
|
/* This is MUI */
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_rlc_mui,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-01-23 15:58:33 +00:00
|
|
|
offset += 2;
|
|
|
|
|
|
|
|
/* CNF follows MUI in AM */
|
|
|
|
if ((opcode == RLC_AM_DATA_REQ) || (opcode == RLC_AM_DATA_IND)) {
|
2015-04-17 02:40:34 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_rlc_cnf,
|
|
|
|
tvb, offset, 1, ENC_NA);
|
2009-01-23 15:58:33 +00:00
|
|
|
offset++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (tag == 0x45) {
|
|
|
|
/* Discard Req */
|
|
|
|
offset++;
|
2015-04-17 02:40:34 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_rlc_discard_req,
|
|
|
|
tvb, offset, 1, ENC_NA);
|
2009-01-23 15:58:33 +00:00
|
|
|
offset++;
|
|
|
|
}
|
|
|
|
|
|
|
|
tag = tvb_get_guint8(tvb, offset++);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/********************************/
|
|
|
|
/* Should be at data tag now */
|
|
|
|
|
|
|
|
/* Call PDCP LTE dissector */
|
2013-02-19 23:17:07 +00:00
|
|
|
pdcp_lte_tvb = tvb_new_subset_remaining(tvb, offset);
|
2012-09-11 08:28:07 +00:00
|
|
|
call_dissector_only(pdcp_lte_handle, pdcp_lte_tvb, pinfo, tree, NULL);
|
2009-01-23 15:58:33 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-08-02 09:30:28 +00:00
|
|
|
|
2008-02-03 23:04:04 +00:00
|
|
|
/* Look up dissector by protocol name. Fix up known name mis-matches.
|
|
|
|
This includes exact matches and prefixes (e.g. "diameter_rx" -> "diameter") */
|
2011-01-12 02:25:08 +00:00
|
|
|
static dissector_handle_t look_for_dissector(const char *protocol_name)
|
2006-08-02 09:30:28 +00:00
|
|
|
{
|
2008-02-03 23:04:04 +00:00
|
|
|
/* Use known aliases and protocol name prefixes */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (strcmp(protocol_name, "tbcp") == 0) {
|
2006-08-02 09:30:28 +00:00
|
|
|
return find_dissector("rtcp");
|
|
|
|
}
|
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (strncmp(protocol_name, "diameter", strlen("diameter")) == 0) {
|
2006-08-02 09:30:28 +00:00
|
|
|
return find_dissector("diameter");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
if ((strcmp(protocol_name, "xcap_caps") == 0) ||
|
2007-12-03 15:47:08 +00:00
|
|
|
(strcmp(protocol_name, "soap") == 0) ||
|
2006-08-02 09:30:28 +00:00
|
|
|
(strcmp(protocol_name, "mm1") == 0) ||
|
2006-11-30 11:36:28 +00:00
|
|
|
(strcmp(protocol_name, "mm3") == 0) ||
|
2009-07-13 10:55:53 +00:00
|
|
|
(strcmp(protocol_name, "mm7") == 0)) {
|
|
|
|
|
2006-08-02 09:30:28 +00:00
|
|
|
return find_dissector("http");
|
|
|
|
}
|
2006-09-04 11:04:14 +00:00
|
|
|
else
|
|
|
|
if ((strcmp(protocol_name, "fp") == 0) ||
|
2012-09-24 10:34:27 +00:00
|
|
|
(strncmp(protocol_name, "fp_r", 4) == 0) ||
|
2009-07-13 10:55:53 +00:00
|
|
|
(strcmp(protocol_name, "fpiur_r5") == 0)) {
|
|
|
|
|
2006-09-04 11:04:14 +00:00
|
|
|
return find_dissector("fp");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
if ((strcmp(protocol_name, "iuup_rtp_r5") == 0) ||
|
2009-07-13 10:55:53 +00:00
|
|
|
(strcmp(protocol_name, "iuup_rtp_r6") == 0)) {
|
|
|
|
|
2006-09-04 11:04:14 +00:00
|
|
|
return find_dissector("rtp");
|
|
|
|
}
|
2006-10-23 17:22:20 +00:00
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (strcmp(protocol_name, "sipt") == 0) {
|
2006-10-23 17:22:20 +00:00
|
|
|
return find_dissector("sip");
|
|
|
|
}
|
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (strncmp(protocol_name, "nbap_sctp", strlen("nbap_sctp")) == 0) {
|
2006-10-23 17:22:20 +00:00
|
|
|
return find_dissector("nbap");
|
|
|
|
}
|
2006-10-25 16:46:27 +00:00
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (strncmp(protocol_name, "gtp", strlen("gtp")) == 0) {
|
2006-10-25 16:46:27 +00:00
|
|
|
return find_dissector("gtp");
|
|
|
|
}
|
2007-04-11 14:34:56 +00:00
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (strcmp(protocol_name, "dhcpv4") == 0) {
|
2007-04-11 14:34:56 +00:00
|
|
|
return find_dissector("bootp");
|
|
|
|
}
|
2007-09-06 10:50:17 +00:00
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (strcmp(protocol_name, "wimax") == 0) {
|
2007-09-06 10:50:17 +00:00
|
|
|
return find_dissector("wimaxasncp");
|
|
|
|
}
|
2007-09-17 16:03:49 +00:00
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (strncmp(protocol_name, "sabp", strlen("sabp")) == 0) {
|
2007-09-17 16:03:49 +00:00
|
|
|
return find_dissector("sabp");
|
|
|
|
}
|
2008-01-16 14:19:45 +00:00
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (strcmp(protocol_name, "wtp") == 0) {
|
2008-01-16 14:19:45 +00:00
|
|
|
return find_dissector("wtp-udp");
|
|
|
|
}
|
2008-02-03 23:04:04 +00:00
|
|
|
else
|
2009-08-15 01:29:29 +00:00
|
|
|
/* Only match with s1ap if preference turned on */
|
|
|
|
if (catapult_dct2000_dissect_lte_s1ap &&
|
|
|
|
strncmp(protocol_name, "s1ap", strlen("s1ap")) == 0) {
|
|
|
|
|
2008-02-03 23:04:04 +00:00
|
|
|
return find_dissector("s1ap");
|
|
|
|
}
|
2012-03-06 13:56:02 +00:00
|
|
|
else
|
|
|
|
/* Always try lookup for now */
|
2012-07-18 01:19:48 +00:00
|
|
|
if ((strncmp(protocol_name, "x2ap_r8_lte", strlen("x2ap_r8_lte")) == 0) ||
|
|
|
|
(strncmp(protocol_name, "x2ap_r9_lte", strlen("x2ap_r9_lte")) == 0)) {
|
2012-03-06 13:56:02 +00:00
|
|
|
|
|
|
|
return find_dissector("x2ap");
|
|
|
|
}
|
|
|
|
|
2009-02-12 10:06:23 +00:00
|
|
|
else
|
2012-07-18 01:19:48 +00:00
|
|
|
if ((strcmp(protocol_name, "gtpv2_r8_lte") == 0) ||
|
|
|
|
(strcmp(protocol_name, "gtpv2_r9_lte") == 0)) {
|
2009-02-12 10:06:23 +00:00
|
|
|
return find_dissector("gtpv2");
|
|
|
|
}
|
|
|
|
|
2006-08-02 09:30:28 +00:00
|
|
|
|
|
|
|
/* Try for an exact match */
|
2009-07-13 10:55:53 +00:00
|
|
|
else {
|
2006-08-02 09:30:28 +00:00
|
|
|
return find_dissector(protocol_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-04 11:04:14 +00:00
|
|
|
/* Populate outhdr_values array with numbers found in outhdr_string */
|
2017-03-28 18:56:53 +00:00
|
|
|
static guint parse_outhdr_string(const guchar *outhdr_string, gint outhdr_string_len, guint *outhdr_values)
|
2006-09-04 11:04:14 +00:00
|
|
|
{
|
2012-03-16 02:00:29 +00:00
|
|
|
int n = 0;
|
2017-03-28 18:56:53 +00:00
|
|
|
int outhdr_values_found;
|
2006-09-04 11:04:14 +00:00
|
|
|
|
|
|
|
/* Populate values array */
|
2009-07-13 10:55:53 +00:00
|
|
|
for (outhdr_values_found=0; outhdr_values_found < MAX_OUTHDR_VALUES; ) {
|
2012-07-12 01:26:08 +00:00
|
|
|
|
|
|
|
guint digit_array[MAX_OUTHDR_VALUES];
|
|
|
|
guint number_digits = 0;
|
|
|
|
|
|
|
|
guint number = 0;
|
|
|
|
guint multiplier = 1;
|
|
|
|
guint d;
|
2006-09-04 11:04:14 +00:00
|
|
|
|
|
|
|
/* Find digits */
|
2016-08-16 21:40:25 +00:00
|
|
|
for ( ; (n < outhdr_string_len) && (number_digits < MAX_OUTHDR_VALUES); n++) {
|
2014-10-20 06:14:50 +00:00
|
|
|
if (!g_ascii_isdigit(outhdr_string[n])) {
|
2006-09-04 11:04:14 +00:00
|
|
|
break;
|
|
|
|
}
|
2012-07-12 01:26:08 +00:00
|
|
|
else {
|
|
|
|
digit_array[number_digits++] = outhdr_string[n] - '0';
|
|
|
|
}
|
2006-09-04 11:04:14 +00:00
|
|
|
}
|
|
|
|
|
2012-07-12 01:26:08 +00:00
|
|
|
if (number_digits == 0) {
|
2006-09-04 11:04:14 +00:00
|
|
|
/* No more numbers left */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-07-12 01:26:08 +00:00
|
|
|
/* Convert digits into value (much faster than format_text() + atoi()) */
|
|
|
|
for (d=number_digits; d > 0; d--) {
|
|
|
|
number += ((digit_array[d-1]) * multiplier);
|
|
|
|
multiplier *= 10;
|
|
|
|
}
|
|
|
|
outhdr_values[outhdr_values_found++] = number;
|
2006-09-04 11:04:14 +00:00
|
|
|
|
|
|
|
/* Skip comma */
|
|
|
|
n++;
|
|
|
|
}
|
2017-03-28 18:56:53 +00:00
|
|
|
return outhdr_values_found;
|
2006-09-04 11:04:14 +00:00
|
|
|
}
|
|
|
|
|
2011-10-28 18:36:20 +00:00
|
|
|
|
|
|
|
|
2006-09-04 11:04:14 +00:00
|
|
|
/* Fill in an FP packet info struct and attach it to the packet for the FP
|
|
|
|
dissector to use */
|
2017-03-28 18:56:53 +00:00
|
|
|
static void attach_fp_info(packet_info *pinfo, gboolean received,
|
|
|
|
const char *protocol_name, int variant,
|
|
|
|
guint *outhdr_values, guint outhdr_values_found)
|
2006-09-04 11:04:14 +00:00
|
|
|
{
|
2017-03-28 18:56:53 +00:00
|
|
|
guint i = 0;
|
|
|
|
int chan;
|
|
|
|
guint tf_start, num_chans_start;
|
|
|
|
gint node_type;
|
|
|
|
int calculated_variant;
|
2006-09-04 11:04:14 +00:00
|
|
|
|
2008-12-23 21:22:47 +00:00
|
|
|
/* Only need to set info once per session. */
|
2013-11-23 02:20:13 +00:00
|
|
|
struct fp_info *p_fp_info = (struct fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
|
2009-07-13 10:55:53 +00:00
|
|
|
if (p_fp_info != NULL) {
|
2008-12-23 21:22:47 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Allocate struct */
|
2013-09-13 17:25:54 +00:00
|
|
|
p_fp_info = wmem_new0(wmem_file_scope(), struct fp_info);
|
2006-09-04 11:04:14 +00:00
|
|
|
|
2007-01-18 11:02:26 +00:00
|
|
|
/* Check that the number of outhdr values looks sensible */
|
|
|
|
if (((strcmp(protocol_name, "fpiur_r5") == 0) && (outhdr_values_found != 2)) ||
|
2009-07-13 10:55:53 +00:00
|
|
|
(outhdr_values_found < 5)) {
|
|
|
|
|
2006-09-04 11:04:14 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-05-20 10:08:28 +00:00
|
|
|
/* 3gpp release (99, 4, 5, 6, 7) */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (strcmp(protocol_name, "fp") == 0) {
|
2006-09-11 12:03:29 +00:00
|
|
|
p_fp_info->release = 99;
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else if (strcmp(protocol_name, "fp_r4") == 0) {
|
2006-09-11 12:03:29 +00:00
|
|
|
p_fp_info->release = 4;
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else if (strcmp(protocol_name, "fp_r5") == 0) {
|
2006-09-11 12:03:29 +00:00
|
|
|
p_fp_info->release = 5;
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else if (strcmp(protocol_name, "fp_r6") == 0) {
|
2006-09-11 12:03:29 +00:00
|
|
|
p_fp_info->release = 6;
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else if (strcmp(protocol_name, "fp_r7") == 0) {
|
2008-05-20 10:08:28 +00:00
|
|
|
p_fp_info->release = 7;
|
|
|
|
}
|
2010-12-15 01:45:43 +00:00
|
|
|
else if (strcmp(protocol_name, "fp_r8") == 0) {
|
|
|
|
p_fp_info->release = 8;
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else if (strcmp(protocol_name, "fpiur_r5") == 0) {
|
2007-01-18 11:02:26 +00:00
|
|
|
p_fp_info->release = 5;
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else {
|
2008-02-03 23:04:04 +00:00
|
|
|
/* Really shouldn't get here */
|
|
|
|
DISSECTOR_ASSERT_NOT_REACHED();
|
2006-09-11 12:03:29 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-02-14 15:41:43 +00:00
|
|
|
/* Release date is derived from variant number */
|
2008-05-20 10:08:28 +00:00
|
|
|
/* Only R6 sub-versions currently influence format within a release */
|
2009-07-13 10:55:53 +00:00
|
|
|
switch (p_fp_info->release) {
|
2007-02-14 15:41:43 +00:00
|
|
|
case 6:
|
2010-08-12 15:30:56 +00:00
|
|
|
if (variant < 256) {
|
|
|
|
calculated_variant = variant;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
calculated_variant = variant / 256;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (calculated_variant) {
|
2007-02-14 15:41:43 +00:00
|
|
|
case 1:
|
|
|
|
p_fp_info->release_year = 2005;
|
|
|
|
p_fp_info->release_month = 6;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
p_fp_info->release_year = 2005;
|
|
|
|
p_fp_info->release_month = 9;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
default:
|
|
|
|
p_fp_info->release_year = 2006;
|
|
|
|
p_fp_info->release_month = 3;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2008-06-06 17:54:59 +00:00
|
|
|
case 7:
|
2008-06-12 16:11:16 +00:00
|
|
|
p_fp_info->release_year = 2008;
|
2008-06-06 17:54:59 +00:00
|
|
|
p_fp_info->release_month = 3;
|
|
|
|
break;
|
2007-02-14 15:41:43 +00:00
|
|
|
|
2010-12-15 01:45:43 +00:00
|
|
|
case 8:
|
|
|
|
p_fp_info->release_year = 2010;
|
|
|
|
p_fp_info->release_month = 6;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
2007-02-14 15:41:43 +00:00
|
|
|
default:
|
|
|
|
p_fp_info->release_year = 0;
|
|
|
|
p_fp_info->release_month = 0;
|
|
|
|
}
|
|
|
|
|
2006-09-11 12:03:29 +00:00
|
|
|
|
2006-09-04 11:04:14 +00:00
|
|
|
/* Channel type */
|
|
|
|
p_fp_info->channel = outhdr_values[i++];
|
2010-11-02 15:20:38 +00:00
|
|
|
/* Sad hack until this value is filled in properly */
|
|
|
|
if (p_fp_info->channel == 0) {
|
|
|
|
p_fp_info->channel = CHANNEL_DCH;
|
|
|
|
}
|
2006-09-04 11:04:14 +00:00
|
|
|
|
2008-06-04 17:33:48 +00:00
|
|
|
/* Derive direction from node type/side */
|
2007-02-14 15:41:43 +00:00
|
|
|
node_type = outhdr_values[i++];
|
|
|
|
p_fp_info->is_uplink = (( received && (node_type == 2)) ||
|
|
|
|
(!received && (node_type == 1)));
|
2006-09-04 11:04:14 +00:00
|
|
|
|
2008-06-04 17:33:48 +00:00
|
|
|
/* Division type introduced for R7 */
|
2011-03-01 10:54:57 +00:00
|
|
|
if ((p_fp_info->release == 7) ||
|
|
|
|
(p_fp_info->release == 8)) {
|
2013-03-14 22:10:59 +00:00
|
|
|
p_fp_info->division = (enum division_type)outhdr_values[i++];
|
2008-06-04 17:33:48 +00:00
|
|
|
}
|
|
|
|
|
2008-05-20 10:08:28 +00:00
|
|
|
/* HS-DSCH config */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (p_fp_info->channel == CHANNEL_HSDSCH) {
|
2011-03-01 10:54:57 +00:00
|
|
|
if ((p_fp_info->release == 7) ||
|
|
|
|
(p_fp_info->release == 8)) {
|
2008-12-23 21:22:47 +00:00
|
|
|
/* Entity (MAC-hs or MAC-ehs) used */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (outhdr_values[i++]) {
|
2008-05-27 10:58:15 +00:00
|
|
|
p_fp_info->hsdsch_entity = ehs;
|
|
|
|
}
|
2008-05-20 10:08:28 +00:00
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else {
|
2008-05-20 10:08:28 +00:00
|
|
|
/* This is the pre-R7 default */
|
|
|
|
p_fp_info->hsdsch_entity = hs;
|
|
|
|
}
|
|
|
|
}
|
2008-05-27 10:58:15 +00:00
|
|
|
|
|
|
|
|
2007-01-18 11:02:26 +00:00
|
|
|
/* IUR only uses the above... */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (strcmp(protocol_name, "fpiur_r5") == 0) {
|
2007-01-18 11:02:26 +00:00
|
|
|
/* Store info in packet */
|
2007-02-14 22:03:39 +00:00
|
|
|
p_fp_info->iface_type = IuR_Interface;
|
2013-11-23 02:20:13 +00:00
|
|
|
p_add_proto_data(wmem_file_scope(), pinfo, proto_fp, 0, p_fp_info);
|
2007-01-18 11:02:26 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-05-08 17:19:18 +00:00
|
|
|
/* DCH CRC present... */
|
2006-09-04 11:04:14 +00:00
|
|
|
p_fp_info->dch_crc_present = outhdr_values[i++];
|
2007-06-14 11:24:37 +00:00
|
|
|
|
2007-05-08 17:19:18 +00:00
|
|
|
/* ... but don't trust for edch */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (p_fp_info->channel == CHANNEL_EDCH) {
|
2007-05-08 17:19:18 +00:00
|
|
|
p_fp_info->dch_crc_present = 2; /* unknown */
|
|
|
|
}
|
2006-09-04 11:04:14 +00:00
|
|
|
|
|
|
|
/* How many paging indications (if PCH data) */
|
|
|
|
p_fp_info->paging_indications = outhdr_values[i++];
|
|
|
|
|
|
|
|
/* Number of channels (for coordinated channels) */
|
|
|
|
p_fp_info->num_chans = outhdr_values[i++];
|
2016-08-16 21:52:03 +00:00
|
|
|
if (p_fp_info->num_chans > MAX_FP_CHANS) {
|
|
|
|
p_fp_info->num_chans = MAX_FP_CHANS;
|
|
|
|
}
|
2006-09-04 11:04:14 +00:00
|
|
|
|
2011-03-01 10:54:57 +00:00
|
|
|
/* EDCH-Common is always T2 */
|
|
|
|
if (p_fp_info->channel == CHANNEL_EDCH_COMMON) {
|
|
|
|
p_fp_info->edch_type = 1;
|
|
|
|
}
|
|
|
|
|
2009-07-13 10:55:53 +00:00
|
|
|
if (p_fp_info->channel != CHANNEL_EDCH) {
|
2006-09-11 12:03:29 +00:00
|
|
|
/* TF size for each channel */
|
|
|
|
tf_start = i;
|
2009-07-13 10:55:53 +00:00
|
|
|
for (chan=0; chan < p_fp_info->num_chans; chan++) {
|
2017-03-28 18:56:53 +00:00
|
|
|
if (outhdr_values_found > tf_start+chan) {
|
|
|
|
p_fp_info->chan_tf_size[chan] = outhdr_values[tf_start+chan];
|
|
|
|
} else {
|
|
|
|
p_fp_info->chan_tf_size[chan] = 0;
|
|
|
|
}
|
2006-09-11 12:03:29 +00:00
|
|
|
}
|
2006-09-04 11:04:14 +00:00
|
|
|
|
2006-09-11 12:03:29 +00:00
|
|
|
/* Number of TBs for each channel */
|
|
|
|
num_chans_start = tf_start + p_fp_info->num_chans;
|
2009-07-13 10:55:53 +00:00
|
|
|
for (chan=0; chan < p_fp_info->num_chans; chan++) {
|
2017-03-28 18:56:53 +00:00
|
|
|
if (outhdr_values_found > num_chans_start+chan) {
|
|
|
|
p_fp_info->chan_num_tbs[chan] = outhdr_values[num_chans_start+chan];
|
|
|
|
} else {
|
|
|
|
p_fp_info->chan_num_tbs[chan] = 0;
|
|
|
|
}
|
2006-09-11 12:03:29 +00:00
|
|
|
}
|
2006-09-04 11:04:14 +00:00
|
|
|
}
|
2006-09-11 12:03:29 +00:00
|
|
|
/* EDCH info */
|
2009-07-13 10:55:53 +00:00
|
|
|
else {
|
2006-09-11 12:03:29 +00:00
|
|
|
int n;
|
2006-09-04 11:04:14 +00:00
|
|
|
|
2006-09-11 12:03:29 +00:00
|
|
|
p_fp_info->no_ddi_entries = outhdr_values[i++];
|
|
|
|
|
|
|
|
/* DDI values */
|
2009-07-13 10:55:53 +00:00
|
|
|
for (n=0; n < p_fp_info->no_ddi_entries; n++) {
|
2017-03-28 18:56:53 +00:00
|
|
|
if (outhdr_values_found > i) {
|
|
|
|
p_fp_info->edch_ddi[n] = outhdr_values[i++];
|
|
|
|
} else {
|
|
|
|
p_fp_info->edch_ddi[n] = 0;
|
|
|
|
}
|
2006-09-11 12:03:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Corresponding MAC-d sizes */
|
2009-07-13 10:55:53 +00:00
|
|
|
for (n=0; n < p_fp_info->no_ddi_entries; n++) {
|
2017-03-28 18:56:53 +00:00
|
|
|
if (outhdr_values_found > i) {
|
|
|
|
p_fp_info->edch_macd_pdu_size[n] = outhdr_values[i++];
|
|
|
|
} else {
|
|
|
|
p_fp_info->edch_macd_pdu_size[n] = 0;
|
|
|
|
}
|
2006-09-11 12:03:29 +00:00
|
|
|
}
|
2010-12-15 01:45:43 +00:00
|
|
|
|
|
|
|
if (strcmp(protocol_name, "fp_r8") == 0) {
|
2017-03-28 18:56:53 +00:00
|
|
|
if (outhdr_values_found > i) {
|
|
|
|
p_fp_info->edch_type = outhdr_values[i];
|
|
|
|
} else {
|
|
|
|
p_fp_info->edch_type = 0;
|
|
|
|
}
|
2010-12-15 01:45:43 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
p_fp_info->edch_type = 0;
|
|
|
|
}
|
2006-09-11 12:03:29 +00:00
|
|
|
}
|
2006-09-04 11:04:14 +00:00
|
|
|
|
2007-02-14 15:41:43 +00:00
|
|
|
/* Interface must be IuB */
|
2007-02-14 22:03:39 +00:00
|
|
|
p_fp_info->iface_type = IuB_Interface;
|
2007-02-14 15:41:43 +00:00
|
|
|
|
2006-09-04 11:04:14 +00:00
|
|
|
/* Store info in packet */
|
2013-11-23 02:20:13 +00:00
|
|
|
p_add_proto_data(wmem_file_scope(), pinfo, proto_fp, 0, p_fp_info);
|
2006-09-04 11:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-10-28 18:36:20 +00:00
|
|
|
/* Fill in an RLC packet info struct and attach it to the packet for the RLC
|
|
|
|
dissector to use */
|
2017-03-28 18:56:53 +00:00
|
|
|
static void attach_rlc_info(packet_info *pinfo, guint32 urnti, guint8 rbid,
|
|
|
|
gboolean is_sent, guint *outhdr_values,
|
|
|
|
guint outhdr_values_found)
|
2011-10-28 18:36:20 +00:00
|
|
|
{
|
|
|
|
/* Only need to set info once per session. */
|
2012-04-28 16:23:23 +00:00
|
|
|
struct fp_info *p_fp_info;
|
2017-06-18 02:03:11 +00:00
|
|
|
struct rlc_info *p_rlc_info = (struct rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0);
|
2012-03-16 02:00:29 +00:00
|
|
|
|
2011-10-28 18:36:20 +00:00
|
|
|
if (p_rlc_info != NULL) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check that the number of outhdr values looks correct */
|
|
|
|
if (outhdr_values_found != 2) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Allocate structs */
|
2013-09-13 17:25:54 +00:00
|
|
|
p_rlc_info = wmem_new(wmem_file_scope(), struct rlc_info);
|
2017-06-23 11:43:05 +00:00
|
|
|
p_fp_info = wmem_new0(wmem_file_scope(), struct fp_info);
|
2011-10-28 18:36:20 +00:00
|
|
|
|
|
|
|
/* Fill in struct fields for first (only) PDU in this frame */
|
|
|
|
|
|
|
|
/* Urnti. Just use UEId */
|
2017-06-19 05:54:55 +00:00
|
|
|
p_rlc_info->ueid[0] = urnti;
|
2011-10-28 18:36:20 +00:00
|
|
|
|
|
|
|
/* ciphered (off by default) */
|
|
|
|
p_rlc_info->ciphered[0] = FALSE;
|
|
|
|
|
|
|
|
/* deciphered (off by default) */
|
|
|
|
p_rlc_info->deciphered[0] = FALSE;
|
|
|
|
|
|
|
|
/* Mode. */
|
|
|
|
switch (outhdr_values[1]) {
|
|
|
|
case 1:
|
|
|
|
p_rlc_info->mode[0] = RLC_TM;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
p_rlc_info->mode[0] = RLC_UM;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
p_rlc_info->mode[0] = RLC_AM;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
p_rlc_info->mode[0] = RLC_UM;
|
|
|
|
p_rlc_info->ciphered[0] = TRUE;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
p_rlc_info->mode[0] = RLC_AM;
|
|
|
|
p_rlc_info->ciphered[0] = TRUE;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* rbid. TODO: does this need conversion? */
|
|
|
|
p_rlc_info->rbid[0] = rbid;
|
|
|
|
|
|
|
|
/* li_size */
|
2013-03-14 22:10:59 +00:00
|
|
|
p_rlc_info->li_size[0] = (enum rlc_li_size)outhdr_values[0];
|
2011-10-28 18:36:20 +00:00
|
|
|
|
|
|
|
/* Store info in packet */
|
2017-06-18 02:03:11 +00:00
|
|
|
p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0, p_rlc_info);
|
2011-10-28 18:36:20 +00:00
|
|
|
|
|
|
|
/* Also store minimal FP info consulted by RLC dissector
|
|
|
|
TODO: Don't really know direction, but use S/R flag to make
|
|
|
|
logs in same context consistent. Will be correct for NodeB logs,
|
|
|
|
but RLC dissector seems to not use anyway... */
|
|
|
|
p_fp_info->is_uplink = is_sent;
|
|
|
|
p_fp_info->cur_tb = 0; /* Always the first/only one */
|
2013-11-23 02:20:13 +00:00
|
|
|
p_add_proto_data(wmem_file_scope(), pinfo, proto_fp, 0, p_fp_info);
|
2011-10-28 18:36:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-12-23 21:22:47 +00:00
|
|
|
/* Fill in a MAC LTE packet info struct and attach it to the packet for that
|
|
|
|
dissector to use */
|
2017-03-28 18:56:53 +00:00
|
|
|
static void attach_mac_lte_info(packet_info *pinfo, guint *outhdr_values, guint outhdr_values_found)
|
2008-12-23 21:22:47 +00:00
|
|
|
{
|
|
|
|
struct mac_lte_info *p_mac_lte_info;
|
2012-03-16 02:00:29 +00:00
|
|
|
unsigned int i = 0;
|
2008-12-23 21:22:47 +00:00
|
|
|
|
|
|
|
/* Only need to set info once per session. */
|
2011-02-02 23:21:16 +00:00
|
|
|
p_mac_lte_info = get_mac_lte_proto_data(pinfo);
|
2009-07-13 10:55:53 +00:00
|
|
|
if (p_mac_lte_info != NULL) {
|
2008-12-23 21:22:47 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Allocate & zero struct */
|
2013-09-13 17:25:54 +00:00
|
|
|
p_mac_lte_info = wmem_new0(wmem_file_scope(), struct mac_lte_info);
|
2008-12-23 21:22:47 +00:00
|
|
|
|
|
|
|
/* Populate the struct from outhdr values */
|
2013-12-22 21:16:31 +00:00
|
|
|
p_mac_lte_info->crcStatusValid = FALSE; /* not set yet */
|
2009-03-23 22:16:25 +00:00
|
|
|
|
2010-01-08 16:08:22 +00:00
|
|
|
p_mac_lte_info->radioType = outhdr_values[i++] + 1;
|
2008-12-23 21:22:47 +00:00
|
|
|
p_mac_lte_info->rntiType = outhdr_values[i++];
|
|
|
|
p_mac_lte_info->direction = outhdr_values[i++];
|
2010-03-14 17:56:37 +00:00
|
|
|
/* Set these extra PHY present flags to FALSE by default */
|
|
|
|
if (p_mac_lte_info->direction == DIRECTION_UPLINK) {
|
|
|
|
p_mac_lte_info->detailed_phy_info.ul_info.present = FALSE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
p_mac_lte_info->detailed_phy_info.dl_info.present = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-12-23 21:22:47 +00:00
|
|
|
p_mac_lte_info->subframeNumber = outhdr_values[i++];
|
2009-03-16 15:39:52 +00:00
|
|
|
p_mac_lte_info->isPredefinedData = outhdr_values[i++];
|
2008-12-23 21:22:47 +00:00
|
|
|
p_mac_lte_info->rnti = outhdr_values[i++];
|
|
|
|
p_mac_lte_info->ueid = outhdr_values[i++];
|
2009-03-23 22:16:25 +00:00
|
|
|
p_mac_lte_info->length = outhdr_values[i++];
|
2009-03-16 15:39:52 +00:00
|
|
|
if (outhdr_values_found > 8) {
|
|
|
|
p_mac_lte_info->reTxCount = outhdr_values[i++];
|
|
|
|
}
|
2010-03-14 17:56:37 +00:00
|
|
|
if (outhdr_values_found == 10) {
|
2009-08-25 11:01:51 +00:00
|
|
|
/* CRC only valid for Downlink */
|
|
|
|
if (p_mac_lte_info->direction == DIRECTION_DOWNLINK) {
|
2013-12-22 21:16:31 +00:00
|
|
|
p_mac_lte_info->crcStatusValid = TRUE;
|
|
|
|
p_mac_lte_info->crcStatus = (mac_lte_crc_status)outhdr_values[i++];
|
2009-03-24 17:28:30 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
i++;
|
|
|
|
}
|
2009-03-23 22:16:25 +00:00
|
|
|
}
|
|
|
|
|
2010-07-05 10:35:17 +00:00
|
|
|
p_mac_lte_info->dl_retx = dl_retx_unknown;
|
|
|
|
|
2010-03-14 17:56:37 +00:00
|
|
|
if (outhdr_values_found > 10) {
|
|
|
|
/* Extra PHY parameters */
|
|
|
|
if (p_mac_lte_info->direction == DIRECTION_DOWNLINK) {
|
|
|
|
p_mac_lte_info->detailed_phy_info.dl_info.present = outhdr_values[i++];
|
|
|
|
p_mac_lte_info->detailed_phy_info.dl_info.dci_format = outhdr_values[i++];
|
|
|
|
p_mac_lte_info->detailed_phy_info.dl_info.resource_allocation_type = outhdr_values[i++];
|
|
|
|
p_mac_lte_info->detailed_phy_info.dl_info.aggregation_level = outhdr_values[i++];
|
|
|
|
p_mac_lte_info->detailed_phy_info.dl_info.mcs_index = outhdr_values[i++];
|
|
|
|
p_mac_lte_info->detailed_phy_info.dl_info.redundancy_version_index = outhdr_values[i++];
|
2010-07-05 10:35:17 +00:00
|
|
|
if (outhdr_values[i++]) {
|
|
|
|
p_mac_lte_info->dl_retx = dl_retx_yes;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
p_mac_lte_info->dl_retx = dl_retx_no;
|
|
|
|
}
|
2010-03-14 17:56:37 +00:00
|
|
|
p_mac_lte_info->detailed_phy_info.dl_info.resource_block_length = outhdr_values[i++];
|
2013-12-22 21:16:31 +00:00
|
|
|
p_mac_lte_info->crcStatusValid = TRUE;
|
|
|
|
p_mac_lte_info->crcStatus = (mac_lte_crc_status)outhdr_values[i++];
|
2010-11-02 15:20:38 +00:00
|
|
|
if (outhdr_values_found > 18) {
|
|
|
|
p_mac_lte_info->detailed_phy_info.dl_info.harq_id = outhdr_values[i++];
|
|
|
|
p_mac_lte_info->detailed_phy_info.dl_info.ndi = outhdr_values[i++];
|
|
|
|
}
|
2010-12-05 23:34:11 +00:00
|
|
|
if (outhdr_values_found > 20) {
|
|
|
|
p_mac_lte_info->detailed_phy_info.dl_info.transport_block = outhdr_values[i++];
|
|
|
|
}
|
2010-03-14 17:56:37 +00:00
|
|
|
}
|
|
|
|
else {
|
2011-02-02 23:21:16 +00:00
|
|
|
/* Uplink */
|
2010-03-14 17:56:37 +00:00
|
|
|
p_mac_lte_info->detailed_phy_info.ul_info.present = outhdr_values[i++];
|
|
|
|
p_mac_lte_info->detailed_phy_info.ul_info.modulation_type = outhdr_values[i++];
|
|
|
|
p_mac_lte_info->detailed_phy_info.ul_info.tbs_index = outhdr_values[i++];
|
|
|
|
p_mac_lte_info->detailed_phy_info.ul_info.resource_block_length = outhdr_values[i++];
|
|
|
|
p_mac_lte_info->detailed_phy_info.ul_info.resource_block_start = outhdr_values[i++];
|
2010-12-23 11:09:52 +00:00
|
|
|
/* Skip retx flag */
|
|
|
|
i++;
|
2010-12-23 12:16:37 +00:00
|
|
|
|
|
|
|
if (outhdr_values_found == 16) {
|
|
|
|
p_mac_lte_info->subframeNumberOfGrantPresent = TRUE;
|
2011-11-21 16:18:33 +00:00
|
|
|
p_mac_lte_info->subframeNumberOfGrant = outhdr_values[i++];
|
2010-12-23 12:16:37 +00:00
|
|
|
}
|
|
|
|
if (outhdr_values_found > 16) {
|
2010-12-05 23:34:11 +00:00
|
|
|
p_mac_lte_info->detailed_phy_info.ul_info.harq_id = outhdr_values[i++];
|
|
|
|
p_mac_lte_info->detailed_phy_info.ul_info.ndi = outhdr_values[i++];
|
2010-12-23 12:16:37 +00:00
|
|
|
|
|
|
|
p_mac_lte_info->subframeNumberOfGrantPresent = TRUE;
|
2011-11-21 16:18:33 +00:00
|
|
|
p_mac_lte_info->subframeNumberOfGrant = outhdr_values[i++];
|
2010-12-05 23:34:11 +00:00
|
|
|
}
|
2010-03-14 17:56:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-21 16:18:33 +00:00
|
|
|
/* System frame number */
|
|
|
|
if (i < outhdr_values_found) {
|
2011-11-25 11:19:03 +00:00
|
|
|
p_mac_lte_info->sysframeNumber = outhdr_values[i++];
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((p_mac_lte_info->direction == DIRECTION_UPLINK) &&
|
|
|
|
(i < outhdr_values_found)) {
|
|
|
|
|
|
|
|
p_mac_lte_info->isPHICHNACK = outhdr_values[i];
|
2011-11-21 16:18:33 +00:00
|
|
|
}
|
|
|
|
|
2012-04-25 20:02:12 +00:00
|
|
|
if (p_mac_lte_info->direction == DIRECTION_UPLINK) {
|
|
|
|
/* R10 parameter not set yet */
|
|
|
|
p_mac_lte_info->isExtendedBSRSizes = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-12-23 21:22:47 +00:00
|
|
|
/* Store info in packet */
|
2011-02-02 23:21:16 +00:00
|
|
|
set_mac_lte_proto_data(pinfo, p_mac_lte_info);
|
2008-12-23 21:22:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Fill in a RLC LTE packet info struct and attach it to the packet for that
|
|
|
|
dissector to use */
|
2017-03-28 18:56:53 +00:00
|
|
|
static void attach_rlc_lte_info(packet_info *pinfo, guint *outhdr_values,
|
|
|
|
guint outhdr_values_found _U_)
|
2008-12-23 21:22:47 +00:00
|
|
|
{
|
|
|
|
struct rlc_lte_info *p_rlc_lte_info;
|
2012-03-16 02:00:29 +00:00
|
|
|
unsigned int i = 0;
|
2008-12-23 21:22:47 +00:00
|
|
|
|
|
|
|
/* Only need to set info once per session. */
|
2013-11-23 02:20:13 +00:00
|
|
|
p_rlc_lte_info = (rlc_lte_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_rlc_lte, 0);
|
2009-07-13 10:55:53 +00:00
|
|
|
if (p_rlc_lte_info != NULL) {
|
2008-12-23 21:22:47 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Allocate & zero struct */
|
2013-09-13 17:25:54 +00:00
|
|
|
p_rlc_lte_info = wmem_new0(wmem_file_scope(), rlc_lte_info);
|
2008-12-23 21:22:47 +00:00
|
|
|
|
|
|
|
p_rlc_lte_info->rlcMode = outhdr_values[i++];
|
|
|
|
p_rlc_lte_info->direction = outhdr_values[i++];
|
|
|
|
p_rlc_lte_info->priority = outhdr_values[i++];
|
2016-01-31 10:39:14 +00:00
|
|
|
p_rlc_lte_info->sequenceNumberLength = outhdr_values[i++];
|
2008-12-23 21:22:47 +00:00
|
|
|
p_rlc_lte_info->channelId = outhdr_values[i++];
|
|
|
|
p_rlc_lte_info->channelType = outhdr_values[i++];
|
|
|
|
p_rlc_lte_info->ueid = outhdr_values[i++];
|
2011-03-16 23:01:33 +00:00
|
|
|
p_rlc_lte_info->pduLength = outhdr_values[i];
|
2008-12-23 21:22:47 +00:00
|
|
|
|
|
|
|
/* Store info in packet */
|
2013-11-23 02:20:13 +00:00
|
|
|
p_add_proto_data(wmem_file_scope(), pinfo, proto_rlc_lte, 0, p_rlc_lte_info);
|
2008-12-23 21:22:47 +00:00
|
|
|
}
|
|
|
|
|
2009-01-23 15:58:33 +00:00
|
|
|
/* Fill in a PDCP LTE packet info struct and attach it to the packet for the PDCP LTE
|
2008-12-23 21:22:47 +00:00
|
|
|
dissector to use */
|
2017-03-28 18:56:53 +00:00
|
|
|
static void attach_pdcp_lte_info(packet_info *pinfo, guint *outhdr_values,
|
|
|
|
guint outhdr_values_found _U_)
|
2008-12-23 21:22:47 +00:00
|
|
|
{
|
2009-01-23 15:58:33 +00:00
|
|
|
struct pdcp_lte_info *p_pdcp_lte_info;
|
2012-03-16 02:00:29 +00:00
|
|
|
unsigned int i = 0;
|
2008-12-23 21:22:47 +00:00
|
|
|
|
|
|
|
/* Only need to set info once per session. */
|
2013-11-23 02:20:13 +00:00
|
|
|
p_pdcp_lte_info = (pdcp_lte_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_pdcp_lte, 0);
|
2009-07-13 10:55:53 +00:00
|
|
|
if (p_pdcp_lte_info != NULL) {
|
2008-12-23 21:22:47 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Allocate & zero struct */
|
2013-09-13 17:25:54 +00:00
|
|
|
p_pdcp_lte_info = wmem_new0(wmem_file_scope(), pdcp_lte_info);
|
2008-12-23 21:22:47 +00:00
|
|
|
|
2009-01-23 15:58:33 +00:00
|
|
|
p_pdcp_lte_info->no_header_pdu = outhdr_values[i++];
|
2013-03-14 22:10:59 +00:00
|
|
|
p_pdcp_lte_info->plane = (enum pdcp_plane)outhdr_values[i++];
|
2009-02-20 10:17:52 +00:00
|
|
|
if (p_pdcp_lte_info->plane != USER_PLANE) {
|
|
|
|
p_pdcp_lte_info->plane = SIGNALING_PLANE;
|
|
|
|
}
|
2009-01-23 15:58:33 +00:00
|
|
|
p_pdcp_lte_info->seqnum_length = outhdr_values[i++];
|
2008-12-23 21:22:47 +00:00
|
|
|
|
2013-11-11 22:36:08 +00:00
|
|
|
p_pdcp_lte_info->rohc.rohc_compression = outhdr_values[i++];
|
|
|
|
p_pdcp_lte_info->rohc.rohc_ip_version = outhdr_values[i++];
|
|
|
|
p_pdcp_lte_info->rohc.cid_inclusion_info = outhdr_values[i++];
|
|
|
|
p_pdcp_lte_info->rohc.large_cid_present = outhdr_values[i++];
|
|
|
|
p_pdcp_lte_info->rohc.mode = (enum rohc_mode)outhdr_values[i++];
|
|
|
|
p_pdcp_lte_info->rohc.rnd = outhdr_values[i++];
|
|
|
|
p_pdcp_lte_info->rohc.udp_checksum_present = outhdr_values[i++];
|
|
|
|
p_pdcp_lte_info->rohc.profile = outhdr_values[i];
|
2008-12-23 21:22:47 +00:00
|
|
|
|
2012-01-11 21:31:11 +00:00
|
|
|
/* Remaining 2 (fixed) fields are ah_length and gre_checksum */
|
|
|
|
|
2008-12-23 21:22:47 +00:00
|
|
|
/* Store info in packet */
|
2013-11-23 02:20:13 +00:00
|
|
|
p_add_proto_data(wmem_file_scope(), pinfo, proto_pdcp_lte, 0, p_pdcp_lte_info);
|
2008-12-23 21:22:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-17 16:03:49 +00:00
|
|
|
/* Attempt to show tty (raw character messages) as text lines. */
|
2009-05-26 16:01:12 +00:00
|
|
|
static void dissect_tty_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
|
2007-09-17 16:03:49 +00:00
|
|
|
{
|
|
|
|
gint next_offset;
|
2012-03-16 02:00:29 +00:00
|
|
|
proto_tree *tty_tree;
|
|
|
|
proto_item *ti;
|
2007-09-17 16:03:49 +00:00
|
|
|
int lines = 0;
|
|
|
|
|
|
|
|
/* Create tty tree. */
|
2011-10-04 22:44:31 +00:00
|
|
|
ti = proto_tree_add_item(tree, hf_catapult_dct2000_tty, tvb, offset, -1, ENC_NA);
|
2010-07-29 09:30:09 +00:00
|
|
|
tty_tree = proto_item_add_subtree(ti, ett_catapult_dct2000_tty);
|
2007-09-17 16:03:49 +00:00
|
|
|
|
|
|
|
/* Show the tty lines one at a time. */
|
2015-02-10 12:49:28 +00:00
|
|
|
while (tvb_offset_exists(tvb, offset)) {
|
2007-09-17 16:03:49 +00:00
|
|
|
/* Find the end of the line. */
|
|
|
|
int linelen = tvb_find_line_end_unquoted(tvb, offset, -1, &next_offset);
|
|
|
|
|
|
|
|
/* Extract & add the string. */
|
2014-06-17 15:30:58 +00:00
|
|
|
char *string = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, linelen, ENC_ASCII);
|
2014-10-20 06:14:50 +00:00
|
|
|
if (g_ascii_isprint(string[0])) {
|
|
|
|
/* If the first byte of the string is printable ASCII treat as string... */
|
2010-07-29 09:30:09 +00:00
|
|
|
proto_tree_add_string_format(tty_tree, hf_catapult_dct2000_tty_line,
|
|
|
|
tvb, offset,
|
|
|
|
linelen, string,
|
|
|
|
"%s", string);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* Otherwise show as $hex */
|
|
|
|
int n, idx;
|
|
|
|
char *hex_string;
|
2015-04-16 11:31:57 +00:00
|
|
|
int tty_string_length = tvb_reported_length_remaining(tvb, offset);
|
2010-07-29 09:39:52 +00:00
|
|
|
int hex_string_length = 1+(2*tty_string_length)+1;
|
2013-09-13 17:25:54 +00:00
|
|
|
hex_string = (char *)wmem_alloc(wmem_packet_scope(), hex_string_length);
|
2010-07-29 09:30:09 +00:00
|
|
|
|
2010-07-29 09:39:52 +00:00
|
|
|
idx = g_snprintf(hex_string, hex_string_length, "$");
|
2010-07-29 09:30:09 +00:00
|
|
|
|
|
|
|
/* Write hex out to new string */
|
|
|
|
for (n=0; n < tty_string_length; n++) {
|
2010-07-29 09:39:52 +00:00
|
|
|
idx += g_snprintf(hex_string+idx, 3, "%02x",
|
|
|
|
tvb_get_guint8(tvb, offset+n));
|
2010-07-29 09:30:09 +00:00
|
|
|
}
|
|
|
|
string = hex_string;
|
|
|
|
}
|
2007-09-17 16:03:49 +00:00
|
|
|
lines++;
|
|
|
|
|
|
|
|
/* Show first line in info column */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (lines == 1) {
|
2007-09-17 16:03:49 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "tty (%s", string);
|
2010-07-29 09:30:09 +00:00
|
|
|
proto_item_append_text(ti, " (%s)", string);
|
2007-09-17 16:03:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Move onto next line. */
|
|
|
|
offset = next_offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Close off summary of tty message in info column */
|
|
|
|
if (lines != 0) {
|
2009-07-13 10:55:53 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, (lines > 1) ? "...)" : ")");
|
2007-09-17 16:03:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-09-04 11:04:14 +00:00
|
|
|
|
2009-10-26 15:39:00 +00:00
|
|
|
/* Scan the log comment looking for notable out-of-band MAC events that should
|
|
|
|
be sent to the MAC dissector */
|
|
|
|
static void check_for_oob_mac_lte_events(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree,
|
|
|
|
const char *string)
|
|
|
|
{
|
2012-03-16 02:00:29 +00:00
|
|
|
guint number_of_ues;
|
|
|
|
guint ueids[MAX_SRs];
|
|
|
|
guint rntis[MAX_SRs];
|
|
|
|
guint rapid;
|
|
|
|
guint rach_attempt_number;
|
2012-10-10 15:18:52 +00:00
|
|
|
guint temp;
|
2012-03-16 02:00:29 +00:00
|
|
|
mac_lte_oob_event oob_event;
|
2009-10-26 15:39:00 +00:00
|
|
|
struct mac_lte_info *p_mac_lte_info;
|
2012-03-16 02:00:29 +00:00
|
|
|
guint16 n;
|
2009-10-26 15:39:00 +00:00
|
|
|
|
|
|
|
/* Look for strings matching expected formats */
|
|
|
|
if (sscanf(string, ">> RACH Preamble Request[UE = %u] [RAPID = %u] [Attempt = %u]",
|
2011-05-11 11:10:30 +00:00
|
|
|
&ueids[0], &rapid, &rach_attempt_number) == 3) {
|
2009-10-26 15:39:00 +00:00
|
|
|
oob_event = ltemac_send_preamble;
|
|
|
|
}
|
|
|
|
else
|
2011-05-11 11:10:30 +00:00
|
|
|
if (sscanf(string, ">> Schedule Requests (%u) [UE=%u][RNTI=%u]",
|
|
|
|
&number_of_ues, &ueids[0], &rntis[0]) == 3) {
|
|
|
|
const char *current_position;
|
2010-02-18 21:24:47 +00:00
|
|
|
|
2011-05-11 11:10:30 +00:00
|
|
|
/* Newer, multi-UE format */
|
|
|
|
oob_event = ltemac_send_sr;
|
|
|
|
|
|
|
|
/* Parse other ueid/rnti pairs */
|
|
|
|
number_of_ues = MIN(number_of_ues, MAX_SRs);
|
|
|
|
if (number_of_ues > 1) {
|
|
|
|
current_position = string;
|
|
|
|
|
|
|
|
for (n=1; n < number_of_ues; n++) {
|
|
|
|
|
|
|
|
/* Find the start of the next entry */
|
|
|
|
current_position = strstr(current_position, "] ");
|
|
|
|
if (current_position != NULL) {
|
|
|
|
current_position += 2;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* This is an error - shouldn't happen */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Read this entry */
|
2012-04-28 23:58:06 +00:00
|
|
|
if (sscanf(current_position, "[UE=%u][RNTI=%u]", &ueids[n], &rntis[n]) != 2) {
|
|
|
|
/* Assuming that if we can't read this one there is no point trying others */
|
|
|
|
number_of_ues = n;
|
|
|
|
break;
|
|
|
|
}
|
2011-05-11 11:10:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2012-11-18 01:33:43 +00:00
|
|
|
/* Support both old and new formats of SR failure */
|
|
|
|
if ((sscanf(string, ">> INFO (inst %u) MAC: [UE = %u] SR failed (CRNTI=%u)",
|
|
|
|
&temp, &ueids[0], &rntis[0]) == 3) ||
|
|
|
|
(sscanf(string, ">> INFO MAC: SR failed for UE %u (CRNTI=%u",
|
|
|
|
&ueids[0], &rntis[0]) == 2))
|
|
|
|
{
|
2009-10-26 15:39:00 +00:00
|
|
|
oob_event = ltemac_sr_failure;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* No events found */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We have an event */
|
|
|
|
/* Only need to set info once per session. */
|
2011-02-02 23:21:16 +00:00
|
|
|
p_mac_lte_info = get_mac_lte_proto_data(pinfo);
|
2009-10-26 15:39:00 +00:00
|
|
|
if (p_mac_lte_info == NULL) {
|
|
|
|
|
|
|
|
/* Allocate & zero struct */
|
2013-09-13 17:25:54 +00:00
|
|
|
p_mac_lte_info = wmem_new0(wmem_file_scope(), mac_lte_info);
|
2009-10-26 15:39:00 +00:00
|
|
|
|
|
|
|
/* This indicates to MAC dissector that it has an oob event */
|
|
|
|
p_mac_lte_info->length = 0;
|
|
|
|
|
|
|
|
switch (oob_event) {
|
|
|
|
case ltemac_send_preamble:
|
2011-05-11 11:10:30 +00:00
|
|
|
p_mac_lte_info->ueid = ueids[0];
|
2009-10-26 15:39:00 +00:00
|
|
|
p_mac_lte_info->rapid = rapid;
|
|
|
|
p_mac_lte_info->rach_attempt_number = rach_attempt_number;
|
|
|
|
p_mac_lte_info->direction = DIRECTION_UPLINK;
|
|
|
|
break;
|
|
|
|
case ltemac_send_sr:
|
2011-05-11 11:10:30 +00:00
|
|
|
for (n=0; n < number_of_ues; n++) {
|
|
|
|
p_mac_lte_info->oob_ueid[n] = ueids[n];
|
|
|
|
p_mac_lte_info->oob_rnti[n] = rntis[n];
|
|
|
|
}
|
|
|
|
p_mac_lte_info->number_of_srs = number_of_ues;
|
2009-10-26 15:39:00 +00:00
|
|
|
p_mac_lte_info->direction = DIRECTION_UPLINK;
|
|
|
|
break;
|
|
|
|
case ltemac_sr_failure:
|
2011-05-11 11:10:30 +00:00
|
|
|
p_mac_lte_info->rnti = rntis[0];
|
|
|
|
p_mac_lte_info->ueid = ueids[0];
|
2009-10-26 15:39:00 +00:00
|
|
|
p_mac_lte_info->direction = DIRECTION_DOWNLINK;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2011-05-11 11:10:30 +00:00
|
|
|
p_mac_lte_info->radioType = FDD_RADIO; /* TODO: will be the same as rest of log... */
|
2009-10-26 15:39:00 +00:00
|
|
|
p_mac_lte_info->oob_event = oob_event;
|
|
|
|
|
|
|
|
/* Store info in packet */
|
2011-02-02 23:21:16 +00:00
|
|
|
set_mac_lte_proto_data(pinfo, p_mac_lte_info);
|
2009-10-26 15:39:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Call MAC dissector */
|
2014-07-07 10:06:27 +00:00
|
|
|
call_dissector_only(mac_lte_handle, tvb, pinfo, tree, NULL);
|
2009-10-26 15:39:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-04-14 13:12:13 +00:00
|
|
|
/*****************************************/
|
|
|
|
/* Main dissection function. */
|
|
|
|
/*****************************************/
|
2015-11-10 04:01:28 +00:00
|
|
|
static int
|
|
|
|
dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
2006-04-14 13:12:13 +00:00
|
|
|
{
|
2012-03-16 02:00:29 +00:00
|
|
|
proto_tree *dct2000_tree = NULL;
|
|
|
|
proto_item *ti = NULL;
|
|
|
|
gint offset = 0;
|
|
|
|
gint context_length;
|
|
|
|
const char *context_name;
|
|
|
|
guint8 port_number;
|
|
|
|
gint protocol_length;
|
|
|
|
gint timestamp_length;
|
|
|
|
const char *timestamp_string;
|
|
|
|
gint variant_length;
|
|
|
|
const char *variant_string;
|
2016-10-22 18:59:44 +00:00
|
|
|
guint32 variant;
|
2012-03-16 02:00:29 +00:00
|
|
|
gint outhdr_length;
|
|
|
|
const char *outhdr_string;
|
|
|
|
guint8 direction;
|
|
|
|
tvbuff_t *next_tvb;
|
|
|
|
int encap;
|
|
|
|
dissector_handle_t protocol_handle = 0;
|
|
|
|
dissector_handle_t heur_protocol_handle = 0;
|
2016-01-14 00:03:26 +00:00
|
|
|
void *protocol_data = 0;
|
2012-03-16 02:00:29 +00:00
|
|
|
int sub_dissector_result = 0;
|
|
|
|
const char *protocol_name;
|
2013-02-15 23:43:30 +00:00
|
|
|
gboolean is_comment, is_sprint = FALSE;
|
2017-03-28 18:56:53 +00:00
|
|
|
guint outhdr_values[MAX_OUTHDR_VALUES];
|
|
|
|
guint outhdr_values_found;
|
2006-04-14 13:12:13 +00:00
|
|
|
|
2007-11-02 22:34:18 +00:00
|
|
|
/* Set Protocol */
|
2009-07-13 10:55:53 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DCT2000");
|
2006-04-14 13:12:13 +00:00
|
|
|
|
2007-11-02 22:34:18 +00:00
|
|
|
/* Clear Info */
|
2009-07-13 10:55:53 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2006-04-14 13:12:13 +00:00
|
|
|
|
2007-11-02 22:34:18 +00:00
|
|
|
/* Create root (protocol) tree. */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (tree) {
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_catapult_dct2000, tvb, offset, -1, ENC_NA);
|
2006-10-05 14:10:10 +00:00
|
|
|
dct2000_tree = proto_item_add_subtree(ti, ett_catapult_dct2000);
|
|
|
|
}
|
2006-04-14 13:12:13 +00:00
|
|
|
|
2007-11-02 22:34:18 +00:00
|
|
|
/*********************************************************************/
|
|
|
|
/* Note that these are the fields of the stub header as written out */
|
|
|
|
/* by the wiretap module */
|
|
|
|
|
2006-04-14 13:12:13 +00:00
|
|
|
/* Context Name */
|
2012-12-03 01:45:00 +00:00
|
|
|
context_name = tvb_get_const_stringz(tvb, offset, &context_length);
|
2008-02-03 23:04:04 +00:00
|
|
|
if (dct2000_tree) {
|
|
|
|
proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_context, tvb,
|
2011-10-15 18:46:26 +00:00
|
|
|
offset, context_length, ENC_ASCII|ENC_NA);
|
2008-02-03 23:04:04 +00:00
|
|
|
}
|
2006-04-14 13:12:13 +00:00
|
|
|
offset += context_length;
|
|
|
|
|
|
|
|
/* Context port number */
|
|
|
|
port_number = tvb_get_guint8(tvb, offset);
|
2008-02-03 23:04:04 +00:00
|
|
|
if (dct2000_tree) {
|
|
|
|
proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_port_number, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset, 1, ENC_BIG_ENDIAN);
|
2008-02-03 23:04:04 +00:00
|
|
|
}
|
2006-04-14 13:12:13 +00:00
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* Timestamp in file */
|
2012-12-03 01:45:00 +00:00
|
|
|
timestamp_string = tvb_get_const_stringz(tvb, offset, ×tamp_length);
|
2008-02-03 23:04:04 +00:00
|
|
|
if (dct2000_tree) {
|
2009-04-28 09:22:35 +00:00
|
|
|
/* TODO: this is *very* slow, but float version adds trailing digits when
|
|
|
|
displayed as a custom column... */
|
2009-04-27 17:44:32 +00:00
|
|
|
proto_tree_add_double(dct2000_tree, hf_catapult_dct2000_timestamp, tvb,
|
|
|
|
offset, timestamp_length,
|
2015-06-25 00:05:30 +00:00
|
|
|
g_ascii_strtod(timestamp_string, NULL));
|
2008-02-03 23:04:04 +00:00
|
|
|
}
|
2006-04-14 13:12:13 +00:00
|
|
|
offset += timestamp_length;
|
|
|
|
|
|
|
|
|
2007-11-02 22:34:18 +00:00
|
|
|
/* DCT2000 protocol name */
|
2012-12-03 01:45:00 +00:00
|
|
|
protocol_name = tvb_get_const_stringz(tvb, offset, &protocol_length);
|
2008-02-03 23:04:04 +00:00
|
|
|
if (dct2000_tree) {
|
|
|
|
proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_protocol, tvb,
|
2011-10-15 18:46:26 +00:00
|
|
|
offset, protocol_length, ENC_ASCII|ENC_NA);
|
2008-02-03 23:04:04 +00:00
|
|
|
}
|
2009-10-26 00:04:27 +00:00
|
|
|
is_comment = (strcmp(protocol_name, "comment") == 0);
|
2013-02-15 23:43:30 +00:00
|
|
|
if (!is_comment) {
|
|
|
|
is_sprint = (strcmp(protocol_name, "sprint") == 0);
|
|
|
|
}
|
2006-04-14 13:12:13 +00:00
|
|
|
offset += protocol_length;
|
|
|
|
|
2009-10-26 00:04:27 +00:00
|
|
|
|
2007-11-02 22:34:18 +00:00
|
|
|
/* Protocol Variant */
|
2012-12-03 01:45:00 +00:00
|
|
|
variant_string = tvb_get_const_stringz(tvb, offset, &variant_length);
|
2013-02-15 23:43:30 +00:00
|
|
|
if (!is_comment && !is_sprint) {
|
2008-02-03 23:04:04 +00:00
|
|
|
proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_variant, tvb,
|
2011-10-15 18:46:26 +00:00
|
|
|
offset, variant_length, ENC_ASCII|ENC_NA);
|
2008-02-03 23:04:04 +00:00
|
|
|
}
|
2006-06-11 08:26:55 +00:00
|
|
|
offset += variant_length;
|
2006-05-23 05:48:00 +00:00
|
|
|
|
2007-11-02 22:34:18 +00:00
|
|
|
/* Outhdr (shown as string) */
|
2012-12-03 01:45:00 +00:00
|
|
|
outhdr_string = tvb_get_const_stringz(tvb, offset, &outhdr_length);
|
2013-02-15 23:43:30 +00:00
|
|
|
if (!is_comment && !is_sprint && (outhdr_length > 1)) {
|
2006-08-02 09:30:28 +00:00
|
|
|
proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_outhdr, tvb,
|
2011-10-15 18:46:26 +00:00
|
|
|
offset, outhdr_length, ENC_ASCII|ENC_NA);
|
2006-08-02 09:30:28 +00:00
|
|
|
}
|
|
|
|
offset += outhdr_length;
|
|
|
|
|
|
|
|
|
2006-04-14 13:12:13 +00:00
|
|
|
/* Direction */
|
|
|
|
direction = tvb_get_guint8(tvb, offset);
|
2008-02-03 23:04:04 +00:00
|
|
|
if (dct2000_tree) {
|
|
|
|
proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_direction, tvb,
|
2011-10-06 03:35:44 +00:00
|
|
|
offset, 1, ENC_BIG_ENDIAN);
|
2008-02-03 23:04:04 +00:00
|
|
|
}
|
2006-04-14 13:12:13 +00:00
|
|
|
offset++;
|
|
|
|
|
2007-11-02 22:34:18 +00:00
|
|
|
/* Read frame encapsulation set by wiretap */
|
2013-02-15 23:43:30 +00:00
|
|
|
if (!is_comment && !is_sprint) {
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_encap, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2008-02-03 23:04:04 +00:00
|
|
|
}
|
2006-04-14 13:12:13 +00:00
|
|
|
encap = tvb_get_guint8(tvb, offset);
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
/* Add useful details to protocol tree label */
|
2009-10-26 00:04:27 +00:00
|
|
|
proto_item_append_text(ti, " context=%s.%u t=%s %c prot=%s (v=%s)",
|
2011-01-12 02:25:08 +00:00
|
|
|
context_name,
|
2009-10-26 00:04:27 +00:00
|
|
|
port_number,
|
2011-01-12 02:25:08 +00:00
|
|
|
timestamp_string,
|
2009-10-26 00:04:27 +00:00
|
|
|
(direction == 0) ? 'S' : 'R',
|
|
|
|
protocol_name,
|
2011-01-12 02:25:08 +00:00
|
|
|
variant_string);
|
2006-04-14 13:12:13 +00:00
|
|
|
|
|
|
|
|
2017-03-28 18:56:53 +00:00
|
|
|
memset(outhdr_values, 0, sizeof outhdr_values);
|
|
|
|
outhdr_values_found = 0;
|
|
|
|
|
2006-09-04 11:04:14 +00:00
|
|
|
/* FP protocols need info from outhdr attached */
|
|
|
|
if ((strcmp(protocol_name, "fp") == 0) ||
|
2012-09-24 10:34:27 +00:00
|
|
|
(strncmp(protocol_name, "fp_r", 4) == 0) ||
|
2009-07-13 10:55:53 +00:00
|
|
|
(strcmp(protocol_name, "fpiur_r5") == 0)) {
|
|
|
|
|
2017-03-28 18:56:53 +00:00
|
|
|
outhdr_values_found = parse_outhdr_string(outhdr_string, outhdr_length,
|
|
|
|
outhdr_values);
|
2016-10-22 18:59:44 +00:00
|
|
|
if (ws_strtou32(variant_string, NULL, &variant))
|
2017-03-28 18:56:53 +00:00
|
|
|
attach_fp_info(pinfo, direction, protocol_name, variant,
|
|
|
|
outhdr_values, outhdr_values_found);
|
2016-10-22 18:59:44 +00:00
|
|
|
else
|
|
|
|
expert_add_info(pinfo, ti, &ei_catapult_dct2000_string_invalid);
|
2006-09-04 11:04:14 +00:00
|
|
|
}
|
|
|
|
|
2011-10-28 18:36:20 +00:00
|
|
|
/* RLC protocols need info from outhdr attached */
|
|
|
|
else if ((strcmp(protocol_name, "rlc") == 0) ||
|
|
|
|
(strcmp(protocol_name, "rlc_r4") == 0) ||
|
|
|
|
(strcmp(protocol_name, "rlc_r5") == 0) ||
|
|
|
|
(strcmp(protocol_name, "rlc_r6") == 0) ||
|
|
|
|
(strcmp(protocol_name, "rlc_r7") == 0) ||
|
2011-11-15 12:03:52 +00:00
|
|
|
(strcmp(protocol_name, "rlc_r8") == 0) ||
|
|
|
|
(strcmp(protocol_name, "rlc_r9") == 0)) {
|
2011-10-28 18:36:20 +00:00
|
|
|
|
2017-03-28 18:56:53 +00:00
|
|
|
outhdr_values_found = parse_outhdr_string(outhdr_string, outhdr_length,
|
|
|
|
outhdr_values);
|
2011-10-28 18:36:20 +00:00
|
|
|
/* Can't attach info yet. Need combination of outheader values
|
|
|
|
and fields parsed from primitive header... */
|
|
|
|
}
|
|
|
|
|
2008-12-23 21:22:47 +00:00
|
|
|
/* LTE MAC needs info attached */
|
2011-01-13 15:16:45 +00:00
|
|
|
else if ((strcmp(protocol_name, "mac_r8_lte") == 0) ||
|
2013-04-18 14:59:41 +00:00
|
|
|
(strcmp(protocol_name, "mac_r9_lte") == 0) ||
|
|
|
|
(strcmp(protocol_name, "mac_r10_lte") == 0)) {
|
2017-03-28 18:56:53 +00:00
|
|
|
outhdr_values_found = parse_outhdr_string(outhdr_string, outhdr_length,
|
|
|
|
outhdr_values);
|
|
|
|
attach_mac_lte_info(pinfo, outhdr_values, outhdr_values_found);
|
2008-12-23 21:22:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* LTE RLC needs info attached */
|
2011-01-13 15:16:45 +00:00
|
|
|
else if ((strcmp(protocol_name, "rlc_r8_lte") == 0) ||
|
2013-04-18 14:59:41 +00:00
|
|
|
(strcmp(protocol_name, "rlc_r9_lte") == 0) ||
|
|
|
|
(strcmp(protocol_name, "rlc_r10_lte") == 0)) {
|
2017-03-28 18:56:53 +00:00
|
|
|
outhdr_values_found = parse_outhdr_string(outhdr_string, outhdr_length,
|
|
|
|
outhdr_values);
|
|
|
|
attach_rlc_lte_info(pinfo, outhdr_values, outhdr_values_found);
|
2008-12-23 21:22:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* LTE PDCP needs info attached */
|
2011-01-13 15:16:45 +00:00
|
|
|
else if ((strcmp(protocol_name, "pdcp_r8_lte") == 0) ||
|
2013-04-18 14:59:41 +00:00
|
|
|
(strcmp(protocol_name, "pdcp_r9_lte") == 0) ||
|
|
|
|
(strcmp(protocol_name, "pdcp_r10_lte") == 0)) {
|
2017-03-28 18:56:53 +00:00
|
|
|
outhdr_values_found = parse_outhdr_string(outhdr_string, outhdr_length,
|
|
|
|
outhdr_values);
|
|
|
|
attach_pdcp_lte_info(pinfo, outhdr_values, outhdr_values_found);
|
2008-12-23 21:22:47 +00:00
|
|
|
}
|
|
|
|
|
2006-09-04 11:04:14 +00:00
|
|
|
|
2012-01-11 21:31:11 +00:00
|
|
|
else if ((strcmp(protocol_name, "nas_rrc_r8_lte") == 0) ||
|
2013-04-18 14:59:41 +00:00
|
|
|
(strcmp(protocol_name, "nas_rrc_r9_lte") == 0) ||
|
|
|
|
(strcmp(protocol_name, "nas_rrc_r10_lte") == 0)) {
|
2012-01-11 21:31:11 +00:00
|
|
|
gboolean nas_body_found = TRUE;
|
2012-03-29 01:24:49 +00:00
|
|
|
guint8 opcode = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_nas_rrc_opcode,
|
|
|
|
tvb, offset++, 1, ENC_BIG_ENDIAN);
|
|
|
|
|
|
|
|
offset++; /* Skip overall length */
|
|
|
|
|
2012-01-11 21:31:11 +00:00
|
|
|
switch (opcode) {
|
2012-03-29 01:24:49 +00:00
|
|
|
case LTE_NAS_RRC_DATA_IND:
|
|
|
|
case LTE_NAS_RRC_DATA_REQ:
|
2012-01-11 21:31:11 +00:00
|
|
|
/* UEId */
|
2012-03-29 01:24:49 +00:00
|
|
|
offset++; /* tag */
|
|
|
|
offset += 2; /* 2 wasted bytes of UEId*/
|
2012-01-11 21:31:11 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_ueid,
|
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
break;
|
2012-03-29 01:24:49 +00:00
|
|
|
case LTE_NAS_RRC_ESTABLISH_REQ:
|
2012-01-11 21:31:11 +00:00
|
|
|
/* UEId */
|
2012-03-29 01:24:49 +00:00
|
|
|
offset++; /* tag */
|
|
|
|
offset += 2; /* 2 wasted bytes of UEId*/
|
2012-01-11 21:31:11 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_ueid,
|
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
|
2012-03-29 01:24:49 +00:00
|
|
|
/* Establish cause. TODO: value_string */
|
|
|
|
offset += 2; /* tag + length */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_nas_rrc_establish_cause,
|
|
|
|
tvb, offset++, 1, ENC_BIG_ENDIAN);
|
|
|
|
|
|
|
|
/* Priority. TODO: Vals are low | high */
|
|
|
|
offset += 2; /* tag + length */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_nas_rrc_priority,
|
|
|
|
tvb, offset++, 1, ENC_BIG_ENDIAN);
|
2012-01-11 21:31:11 +00:00
|
|
|
break;
|
2012-03-29 01:24:49 +00:00
|
|
|
case LTE_NAS_RRC_RELEASE_IND:
|
2012-01-11 21:31:11 +00:00
|
|
|
/* UEId */
|
2012-03-29 01:24:49 +00:00
|
|
|
offset++; /* tag */
|
|
|
|
offset += 2; /* 2 wasted bytes of UEId*/
|
2012-01-11 21:31:11 +00:00
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_ueid,
|
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
offset += 2;
|
|
|
|
|
2012-03-29 01:24:49 +00:00
|
|
|
/* Release cause. TODO: value_string */
|
|
|
|
offset += 2; /* tag + length */
|
|
|
|
proto_tree_add_item(tree, hf_catapult_dct2000_lte_nas_rrc_release_cause,
|
|
|
|
tvb, offset++, 1, ENC_BIG_ENDIAN);
|
2012-01-11 21:31:11 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
nas_body_found = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Look up dissector if if looks right */
|
|
|
|
if (nas_body_found) {
|
|
|
|
offset += 2; /* L3 tag + len */
|
|
|
|
protocol_handle = find_dissector("nas-eps");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-04-17 18:46:14 +00:00
|
|
|
/* Note that the first item of pinfo->pseudo_header->dct2000 will contain
|
2008-12-18 19:08:49 +00:00
|
|
|
the pseudo-header needed (in some cases) by the Wireshark dissector that
|
2007-11-02 22:34:18 +00:00
|
|
|
this packet data will be handed off to. */
|
2006-04-14 13:12:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************/
|
|
|
|
/* Now hand off to the dissector of intended packet encapsulation type */
|
|
|
|
|
|
|
|
/* Get protocol handle, and set p2p_dir where necessary.
|
|
|
|
(packet-frame.c won't copy it from pseudo-header because it doesn't
|
2007-12-03 15:47:08 +00:00
|
|
|
know about Catapult DCT2000 encap type...)
|
2006-04-14 13:12:13 +00:00
|
|
|
*/
|
2009-07-13 10:55:53 +00:00
|
|
|
switch (encap) {
|
2006-04-14 13:12:13 +00:00
|
|
|
case WTAP_ENCAP_RAW_IP:
|
|
|
|
protocol_handle = find_dissector("ip");
|
2011-10-28 18:36:20 +00:00
|
|
|
#if 0
|
|
|
|
/* TODO: this doesn't work yet.
|
|
|
|
pseudo_header isn't copied from wtap to pinfo... */
|
|
|
|
if ((pinfo->pseudo_header != NULL) &&
|
|
|
|
(pinfo->pseudo_header->dct2000.inner_pseudo_header.pdcp.ueid != 0)) {
|
|
|
|
|
|
|
|
proto_item *ti;
|
|
|
|
|
|
|
|
/* Add PDCP thread info as generated fields */
|
|
|
|
ti = proto_tree_add_uint(dct2000_tree, hf_catapult_dct2000_lte_ueid, tvb, 0, 0,
|
|
|
|
pinfo->pseudo_header->dct2000.inner_pseudo_header.pdcp.ueid);
|
|
|
|
PROTO_ITEM_SET_GENERATED(ti);
|
|
|
|
ti = proto_tree_add_uint(dct2000_tree, hf_catapult_dct2000_lte_drbid, tvb, 0, 0,
|
|
|
|
pinfo->pseudo_header->dct2000.inner_pseudo_header.pdcp.drbid);
|
|
|
|
PROTO_ITEM_SET_GENERATED(ti);
|
|
|
|
}
|
|
|
|
#endif
|
2006-04-14 13:12:13 +00:00
|
|
|
break;
|
|
|
|
case WTAP_ENCAP_ETHERNET:
|
|
|
|
protocol_handle = find_dissector("eth_withoutfcs");
|
|
|
|
break;
|
|
|
|
case WTAP_ENCAP_ISDN:
|
|
|
|
protocol_handle = find_dissector("lapd");
|
|
|
|
pinfo->p2p_dir = pinfo->pseudo_header->isdn.uton;
|
|
|
|
break;
|
|
|
|
case WTAP_ENCAP_ATM_PDUS_UNTRUNCATED:
|
|
|
|
protocol_handle = find_dissector("atm_untruncated");
|
2016-01-14 00:03:26 +00:00
|
|
|
protocol_data = &pinfo->pseudo_header->dct2000.inner_pseudo_header.atm;
|
2006-04-14 13:12:13 +00:00
|
|
|
break;
|
|
|
|
case WTAP_ENCAP_PPP:
|
|
|
|
protocol_handle = find_dissector("ppp_hdlc");
|
|
|
|
pinfo->p2p_dir = pinfo->pseudo_header->p2p.sent;
|
|
|
|
break;
|
|
|
|
case DCT2000_ENCAP_SSCOP:
|
|
|
|
protocol_handle = find_dissector("sscop");
|
|
|
|
break;
|
|
|
|
case WTAP_ENCAP_FRELAY:
|
|
|
|
protocol_handle = find_dissector("fr");
|
|
|
|
break;
|
|
|
|
case DCT2000_ENCAP_MTP2:
|
|
|
|
protocol_handle = find_dissector("mtp2");
|
|
|
|
break;
|
2006-10-23 17:22:20 +00:00
|
|
|
case DCT2000_ENCAP_NBAP:
|
|
|
|
protocol_handle = find_dissector("nbap");
|
|
|
|
break;
|
2007-11-02 22:34:18 +00:00
|
|
|
|
2006-04-14 13:12:13 +00:00
|
|
|
case DCT2000_ENCAP_UNHANDLED:
|
2007-11-02 22:34:18 +00:00
|
|
|
/**********************************************************/
|
|
|
|
/* The wiretap module wasn't able to set an encapsulation */
|
|
|
|
/* type, but it may still be possible to dissect the data */
|
|
|
|
/* if we know about the protocol or if we can recognise */
|
|
|
|
/* and parse or skip a primitive header */
|
|
|
|
/**********************************************************/
|
|
|
|
|
2006-09-04 11:04:14 +00:00
|
|
|
/* Show context.port in src or dest column as appropriate */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (direction == 0) {
|
2006-09-04 11:04:14 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_DEF_SRC,
|
|
|
|
"%s.%u",
|
2011-01-12 02:25:08 +00:00
|
|
|
context_name,
|
2006-09-04 11:04:14 +00:00
|
|
|
port_number);
|
|
|
|
}
|
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (direction == 1) {
|
2006-09-04 11:04:14 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_DEF_DST,
|
|
|
|
"%s.%u",
|
2011-01-12 02:25:08 +00:00
|
|
|
context_name,
|
2006-09-04 11:04:14 +00:00
|
|
|
port_number);
|
|
|
|
}
|
|
|
|
|
2007-09-28 16:17:22 +00:00
|
|
|
|
2009-04-18 08:03:09 +00:00
|
|
|
/**************************************************************************/
|
|
|
|
/* These protocols have no encapsulation type, just look them up directly */
|
2011-10-28 18:36:20 +00:00
|
|
|
|
|
|
|
if ((strcmp(protocol_name, "rlc") == 0) ||
|
|
|
|
(strcmp(protocol_name, "rlc_r4") == 0) ||
|
|
|
|
(strcmp(protocol_name, "rlc_r5") == 0) ||
|
|
|
|
(strcmp(protocol_name, "rlc_r6") == 0) ||
|
|
|
|
(strcmp(protocol_name, "rlc_r7") == 0) ||
|
2011-11-15 12:03:52 +00:00
|
|
|
(strcmp(protocol_name, "rlc_r8") == 0) ||
|
|
|
|
(strcmp(protocol_name, "rlc_r9") == 0)) {
|
2011-10-28 18:36:20 +00:00
|
|
|
|
2017-03-28 18:56:53 +00:00
|
|
|
dissect_rlc_umts(tvb, offset, pinfo, tree, direction,
|
|
|
|
outhdr_values, outhdr_values_found);
|
2015-11-10 04:01:28 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2011-10-28 18:36:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
else
|
2011-03-15 17:30:00 +00:00
|
|
|
if ((strcmp(protocol_name, "mac_r8_lte") == 0) ||
|
2013-04-18 14:59:41 +00:00
|
|
|
(strcmp(protocol_name, "mac_r9_lte") == 0) ||
|
|
|
|
(strcmp(protocol_name, "mac_r10_lte") == 0)) {
|
2009-04-18 08:03:09 +00:00
|
|
|
protocol_handle = mac_lte_handle;
|
2007-08-08 13:12:15 +00:00
|
|
|
}
|
2007-09-28 16:17:22 +00:00
|
|
|
|
2009-04-18 08:03:09 +00:00
|
|
|
else
|
2011-03-15 17:30:00 +00:00
|
|
|
if ((strcmp(protocol_name, "rlc_r8_lte") == 0) ||
|
2013-04-18 14:59:41 +00:00
|
|
|
(strcmp(protocol_name, "rlc_r9_lte") == 0) ||
|
|
|
|
(strcmp(protocol_name, "rlc_r10_lte") == 0)) {
|
2009-04-18 08:03:09 +00:00
|
|
|
protocol_handle = rlc_lte_handle;
|
2007-09-17 16:03:49 +00:00
|
|
|
}
|
2007-08-08 13:12:15 +00:00
|
|
|
|
2008-01-16 14:19:45 +00:00
|
|
|
else
|
2011-03-15 17:30:00 +00:00
|
|
|
if ((strcmp(protocol_name, "pdcp_r8_lte") == 0) ||
|
2013-04-18 14:59:41 +00:00
|
|
|
(strcmp(protocol_name, "pdcp_r9_lte") == 0) ||
|
|
|
|
(strcmp(protocol_name, "pdcp_r10_lte") == 0)) {
|
2009-04-18 08:03:09 +00:00
|
|
|
/* Dissect proprietary header, then pass remainder to PDCP */
|
|
|
|
dissect_pdcp_lte(tvb, offset, pinfo, tree);
|
2015-11-10 04:01:28 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2008-01-16 14:19:45 +00:00
|
|
|
}
|
2007-09-28 16:17:22 +00:00
|
|
|
|
2009-04-18 08:03:09 +00:00
|
|
|
|
|
|
|
/* Work with generic XML protocol. */
|
2008-12-23 21:22:47 +00:00
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (strcmp(protocol_name, "xml") == 0) {
|
2009-04-18 08:03:09 +00:00
|
|
|
protocol_handle = find_dissector("xml");
|
2008-12-23 21:22:47 +00:00
|
|
|
}
|
2009-01-02 01:37:55 +00:00
|
|
|
|
2009-04-18 08:03:09 +00:00
|
|
|
|
|
|
|
/* Attempt to show tty messages as raw text */
|
2008-12-23 21:22:47 +00:00
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (strcmp(protocol_name, "tty") == 0) {
|
2009-04-18 08:03:09 +00:00
|
|
|
dissect_tty_lines(tvb, pinfo, dct2000_tree, offset);
|
2015-11-10 04:01:28 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2008-12-23 21:22:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
else
|
2009-07-13 10:55:53 +00:00
|
|
|
if (strcmp(protocol_name, "sipprim") == 0) {
|
2009-04-18 08:03:09 +00:00
|
|
|
protocol_handle = find_dissector("sipprim");
|
2008-12-23 21:22:47 +00:00
|
|
|
}
|
|
|
|
|
2009-10-26 00:04:27 +00:00
|
|
|
else
|
|
|
|
if (strcmp(protocol_name, "comment") == 0) {
|
|
|
|
/* Extract & add the string. */
|
2009-10-28 19:00:41 +00:00
|
|
|
proto_item *string_ti;
|
2016-06-26 14:52:37 +00:00
|
|
|
const guint8 *string;
|
2009-10-26 00:04:27 +00:00
|
|
|
|
|
|
|
/* Show comment string */
|
2016-06-26 14:52:37 +00:00
|
|
|
string_ti = proto_tree_add_item_ret_string(dct2000_tree, hf_catapult_dct2000_comment, tvb,
|
|
|
|
offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII|ENC_NA, wmem_packet_scope(), &string);
|
2017-04-02 18:08:15 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, string);
|
2009-10-26 00:04:27 +00:00
|
|
|
|
2009-10-26 16:40:57 +00:00
|
|
|
if (catapult_dct2000_dissect_mac_lte_oob_messages) {
|
|
|
|
/* Look into string for out-of-band MAC events, such as SRReq, SRInd */
|
|
|
|
check_for_oob_mac_lte_events(pinfo, tvb, tree, string);
|
|
|
|
}
|
2009-10-28 19:00:41 +00:00
|
|
|
|
|
|
|
/* Look for and flag generic error messages */
|
|
|
|
if (strncmp(string, ">> ERR", 6) == 0) {
|
2010-05-25 14:02:17 +00:00
|
|
|
proto_item *error_ti = proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_error_comment, tvb,
|
2011-10-04 22:44:31 +00:00
|
|
|
offset, -1, ENC_NA);
|
2010-05-25 14:02:17 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(error_ti);
|
2013-09-09 00:44:09 +00:00
|
|
|
expert_add_info_format(pinfo, string_ti, &ei_catapult_dct2000_error_comment_expert,
|
2009-10-28 19:00:41 +00:00
|
|
|
"%s", string);
|
|
|
|
}
|
2012-03-29 01:24:49 +00:00
|
|
|
|
2015-11-10 04:01:28 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2009-10-26 00:04:27 +00:00
|
|
|
}
|
|
|
|
|
2013-02-15 23:43:30 +00:00
|
|
|
else
|
|
|
|
if (strcmp(protocol_name, "sprint") == 0) {
|
|
|
|
/* Extract & add the string. */
|
2016-06-26 14:52:37 +00:00
|
|
|
const guint8 *string;
|
2013-02-15 23:43:30 +00:00
|
|
|
|
|
|
|
/* Show sprint string */
|
2016-06-26 14:52:37 +00:00
|
|
|
proto_tree_add_item_ret_string(dct2000_tree, hf_catapult_dct2000_sprint, tvb,
|
|
|
|
offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII|ENC_NA, wmem_packet_scope(), &string);
|
2017-04-02 18:08:15 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, string);
|
2013-02-15 23:43:30 +00:00
|
|
|
|
2015-11-10 04:01:28 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2013-02-15 23:43:30 +00:00
|
|
|
}
|
|
|
|
|
2009-10-26 00:04:27 +00:00
|
|
|
|
2009-01-02 01:37:55 +00:00
|
|
|
else
|
2009-07-07 14:38:14 +00:00
|
|
|
if (catapult_dct2000_dissect_lte_rrc &&
|
|
|
|
((strcmp(protocol_name, "rrc_r8_lte") == 0) ||
|
2012-07-18 01:19:48 +00:00
|
|
|
(strcmp(protocol_name, "rrcpdcpprim_r8_lte") == 0) ||
|
|
|
|
(strcmp(protocol_name, "rrc_r9_lte") == 0) ||
|
2013-04-18 14:59:41 +00:00
|
|
|
(strcmp(protocol_name, "rrcpdcpprim_r9_lte") == 0) ||
|
|
|
|
(strcmp(protocol_name, "rrc_r10_lte") == 0))) {
|
2009-07-13 10:55:53 +00:00
|
|
|
|
2009-01-02 01:37:55 +00:00
|
|
|
/* Dissect proprietary header, then pass remainder
|
|
|
|
to RRC (depending upon direction and channel type) */
|
|
|
|
dissect_rrc_lte(tvb, offset, pinfo, tree);
|
2015-11-10 04:01:28 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2009-01-02 01:37:55 +00:00
|
|
|
}
|
|
|
|
|
2009-12-29 22:57:10 +00:00
|
|
|
else
|
2012-07-18 01:19:48 +00:00
|
|
|
if ((strcmp(protocol_name, "ccpri_r8_lte") == 0) ||
|
|
|
|
(strcmp(protocol_name, "ccpri_r9_lte") == 0)) {
|
2009-12-29 22:57:10 +00:00
|
|
|
|
|
|
|
/* Dissect proprietary header, then pass remainder to lapb */
|
|
|
|
dissect_ccpri_lte(tvb, offset, pinfo, tree);
|
2015-11-10 04:01:28 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2009-12-29 22:57:10 +00:00
|
|
|
}
|
2010-09-23 21:46:31 +00:00
|
|
|
|
2007-11-02 22:34:18 +00:00
|
|
|
/* Many DCT2000 protocols have at least one IPPrim variant. If the
|
|
|
|
protocol name can be matched to a dissector, try to find the
|
|
|
|
UDP/TCP data inside and dissect it.
|
|
|
|
*/
|
|
|
|
|
2009-07-13 10:55:53 +00:00
|
|
|
if (!protocol_handle && catapult_dct2000_try_ipprim_heuristic) {
|
2007-04-11 14:34:56 +00:00
|
|
|
guint32 source_addr_offset = 0, dest_addr_offset = 0;
|
2007-09-28 16:17:22 +00:00
|
|
|
guint8 source_addr_length = 0, dest_addr_length = 0;
|
2007-04-11 14:34:56 +00:00
|
|
|
guint32 source_port_offset = 0, dest_port_offset = 0;
|
|
|
|
port_type type_of_port = PT_NONE;
|
|
|
|
guint16 conn_id_offset = 0;
|
|
|
|
int offset_before_ipprim_header = offset;
|
2006-09-05 16:05:23 +00:00
|
|
|
|
2007-06-15 17:21:13 +00:00
|
|
|
/* Will give up if couldn't match protocol anyway... */
|
2006-10-05 14:10:10 +00:00
|
|
|
heur_protocol_handle = look_for_dissector(protocol_name);
|
2006-08-02 09:30:28 +00:00
|
|
|
if ((heur_protocol_handle != 0) &&
|
2007-02-14 15:41:43 +00:00
|
|
|
find_ipprim_data_offset(tvb, &offset, direction,
|
2007-09-28 16:17:22 +00:00
|
|
|
&source_addr_offset, &source_addr_length,
|
|
|
|
&dest_addr_offset, &dest_addr_length,
|
2006-11-30 11:36:28 +00:00
|
|
|
&source_port_offset, &dest_port_offset,
|
2007-04-11 14:34:56 +00:00
|
|
|
&type_of_port,
|
2009-07-13 10:55:53 +00:00
|
|
|
&conn_id_offset)) {
|
|
|
|
|
2006-10-05 14:10:10 +00:00
|
|
|
proto_tree *ipprim_tree;
|
2008-06-23 21:40:40 +00:00
|
|
|
proto_item *ipprim_ti;
|
2010-08-18 10:33:54 +00:00
|
|
|
struct e_in6_addr sourcev6, destv6;
|
|
|
|
|
|
|
|
/* Fetch IPv6 addresses */
|
|
|
|
if (source_addr_length != 4) {
|
|
|
|
tvb_get_ipv6(tvb, source_addr_offset, &sourcev6);
|
|
|
|
}
|
|
|
|
if (dest_addr_length != 4) {
|
|
|
|
tvb_get_ipv6(tvb, dest_addr_offset, &destv6);
|
|
|
|
}
|
|
|
|
|
2006-09-05 16:05:23 +00:00
|
|
|
|
2007-11-02 22:34:18 +00:00
|
|
|
/* Will use this dissector then. */
|
|
|
|
protocol_handle = heur_protocol_handle;
|
2006-10-05 14:10:10 +00:00
|
|
|
|
|
|
|
/* Add address parameters to tree */
|
|
|
|
/* Unfortunately can't automatically create a conversation filter for this...
|
2007-09-28 16:17:22 +00:00
|
|
|
I *could* create a fake IP header from these details, but then it would be tricky
|
|
|
|
to get the FP dissector called as it has no well-known ports or heuristics... */
|
2008-06-23 21:40:40 +00:00
|
|
|
ipprim_ti = proto_tree_add_string_format(dct2000_tree, hf_catapult_dct2000_ipprim_addresses,
|
2006-11-30 11:36:28 +00:00
|
|
|
tvb, offset_before_ipprim_header, 0,
|
2006-10-05 14:10:10 +00:00
|
|
|
"", "IPPrim transport (%s): %s:%u -> %s:%u",
|
|
|
|
(type_of_port == PT_UDP) ? "UDP" : "TCP",
|
2006-11-30 11:36:28 +00:00
|
|
|
(source_addr_offset) ?
|
2007-09-28 16:17:22 +00:00
|
|
|
((source_addr_length == 4) ?
|
2010-02-27 01:12:24 +00:00
|
|
|
get_hostname(tvb_get_ipv4(tvb, source_addr_offset)) :
|
2010-08-18 10:33:54 +00:00
|
|
|
get_hostname6(&sourcev6)
|
2007-09-28 16:17:22 +00:00
|
|
|
) :
|
2006-11-30 11:36:28 +00:00
|
|
|
"0.0.0.0",
|
|
|
|
(source_port_offset) ?
|
|
|
|
tvb_get_ntohs(tvb, source_port_offset) :
|
|
|
|
0,
|
|
|
|
(dest_addr_offset) ?
|
2007-09-28 16:17:22 +00:00
|
|
|
((source_addr_length == 4) ?
|
2010-02-27 01:12:24 +00:00
|
|
|
get_hostname(tvb_get_ipv4(tvb, dest_addr_offset)) :
|
2010-08-18 10:33:54 +00:00
|
|
|
get_hostname6(&destv6)
|
2007-09-28 16:17:22 +00:00
|
|
|
) :
|
2006-11-30 11:36:28 +00:00
|
|
|
"0.0.0.0",
|
|
|
|
(dest_port_offset) ?
|
|
|
|
tvb_get_ntohs(tvb, dest_port_offset) :
|
|
|
|
0);
|
2007-04-11 14:34:56 +00:00
|
|
|
if ((type_of_port == PT_TCP) && (conn_id_offset != 0)) {
|
2008-06-23 21:40:40 +00:00
|
|
|
proto_item_append_text(ipprim_ti, " (conn_id=%u)", tvb_get_ntohs(tvb, conn_id_offset));
|
2007-04-11 14:34:56 +00:00
|
|
|
}
|
2006-10-05 14:10:10 +00:00
|
|
|
|
2007-04-11 14:34:56 +00:00
|
|
|
/* Add these IPPRIM fields inside an IPPRIM subtree */
|
2008-06-23 21:40:40 +00:00
|
|
|
ipprim_tree = proto_item_add_subtree(ipprim_ti, ett_catapult_dct2000_ipprim);
|
2006-10-05 14:10:10 +00:00
|
|
|
|
2007-06-15 17:21:13 +00:00
|
|
|
/* Try to add right stuff to pinfo so conversation stuff works... */
|
|
|
|
pinfo->ptype = type_of_port;
|
|
|
|
|
|
|
|
/* Add addresses & ports into ipprim tree.
|
|
|
|
Also set address info in pinfo for conversations... */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (source_addr_offset != 0) {
|
2006-10-05 14:10:10 +00:00
|
|
|
proto_item *addr_ti;
|
2007-06-15 17:21:13 +00:00
|
|
|
|
2015-10-29 03:12:53 +00:00
|
|
|
set_address_tvb(&pinfo->net_src,
|
2007-09-28 16:17:22 +00:00
|
|
|
(source_addr_length == 4) ? AT_IPv4 : AT_IPv6,
|
2015-10-29 03:12:53 +00:00
|
|
|
source_addr_length, tvb, source_addr_offset);
|
2015-10-21 19:04:16 +00:00
|
|
|
copy_address_shallow(&pinfo->src, &pinfo->net_src);
|
2007-06-15 17:21:13 +00:00
|
|
|
|
2007-09-28 16:17:22 +00:00
|
|
|
proto_tree_add_item(ipprim_tree,
|
2010-09-23 21:46:31 +00:00
|
|
|
(source_addr_length == 4) ?
|
2007-09-28 16:17:22 +00:00
|
|
|
hf_catapult_dct2000_ipprim_src_addr_v4 :
|
|
|
|
hf_catapult_dct2000_ipprim_src_addr_v6,
|
2011-10-26 18:11:24 +00:00
|
|
|
tvb, source_addr_offset, source_addr_length,
|
2017-03-05 19:52:16 +00:00
|
|
|
ENC_NA);
|
2007-09-28 16:17:22 +00:00
|
|
|
|
|
|
|
/* Add hidden item for "side-less" addr */
|
|
|
|
addr_ti = proto_tree_add_item(ipprim_tree,
|
|
|
|
(source_addr_length == 4) ?
|
|
|
|
hf_catapult_dct2000_ipprim_addr_v4 :
|
|
|
|
hf_catapult_dct2000_ipprim_addr_v6,
|
2011-10-26 18:11:24 +00:00
|
|
|
tvb, source_addr_offset, source_addr_length,
|
2017-03-05 19:52:16 +00:00
|
|
|
ENC_NA);
|
2006-10-05 14:10:10 +00:00
|
|
|
PROTO_ITEM_SET_HIDDEN(addr_ti);
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
if (source_port_offset != 0) {
|
2006-10-05 14:10:10 +00:00
|
|
|
proto_item *port_ti;
|
2007-06-15 17:21:13 +00:00
|
|
|
|
|
|
|
pinfo->srcport = tvb_get_ntohs(tvb, source_port_offset);
|
|
|
|
|
2006-11-30 11:36:28 +00:00
|
|
|
proto_tree_add_item(ipprim_tree,
|
2006-10-05 14:10:10 +00:00
|
|
|
(type_of_port == PT_UDP) ?
|
|
|
|
hf_catapult_dct2000_ipprim_udp_src_port :
|
|
|
|
hf_catapult_dct2000_ipprim_tcp_src_port,
|
2011-10-26 18:11:24 +00:00
|
|
|
tvb, source_port_offset, 2, ENC_BIG_ENDIAN);
|
2006-11-30 11:36:28 +00:00
|
|
|
port_ti = proto_tree_add_item(ipprim_tree,
|
2006-10-05 14:10:10 +00:00
|
|
|
(type_of_port == PT_UDP) ?
|
|
|
|
hf_catapult_dct2000_ipprim_udp_port :
|
|
|
|
hf_catapult_dct2000_ipprim_tcp_port,
|
2011-10-26 18:11:24 +00:00
|
|
|
tvb, source_port_offset, 2, ENC_BIG_ENDIAN);
|
2006-10-05 14:10:10 +00:00
|
|
|
PROTO_ITEM_SET_HIDDEN(port_ti);
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
if (dest_addr_offset != 0) {
|
2006-10-05 14:10:10 +00:00
|
|
|
proto_item *addr_ti;
|
2007-06-15 17:21:13 +00:00
|
|
|
|
2015-10-29 03:12:53 +00:00
|
|
|
set_address_tvb(&pinfo->net_dst,
|
2007-09-28 16:17:22 +00:00
|
|
|
(dest_addr_length == 4) ? AT_IPv4 : AT_IPv6,
|
2015-10-29 03:12:53 +00:00
|
|
|
dest_addr_length, tvb, dest_addr_offset);
|
2015-10-21 19:04:16 +00:00
|
|
|
copy_address_shallow(&pinfo->dst, &pinfo->net_dst);
|
2007-09-28 16:17:22 +00:00
|
|
|
proto_tree_add_item(ipprim_tree,
|
2010-09-23 21:46:31 +00:00
|
|
|
(dest_addr_length == 4) ?
|
2007-09-28 16:17:22 +00:00
|
|
|
hf_catapult_dct2000_ipprim_dst_addr_v4 :
|
|
|
|
hf_catapult_dct2000_ipprim_dst_addr_v6,
|
2011-10-26 18:11:24 +00:00
|
|
|
tvb, dest_addr_offset, dest_addr_length,
|
2017-03-05 19:52:16 +00:00
|
|
|
ENC_NA);
|
2007-09-28 16:17:22 +00:00
|
|
|
|
|
|
|
/* Add hidden item for "side-less" addr */
|
|
|
|
addr_ti = proto_tree_add_item(ipprim_tree,
|
2010-09-23 21:46:31 +00:00
|
|
|
(dest_addr_length == 4) ?
|
2007-09-28 16:17:22 +00:00
|
|
|
hf_catapult_dct2000_ipprim_addr_v4 :
|
|
|
|
hf_catapult_dct2000_ipprim_addr_v6,
|
2011-10-26 18:11:24 +00:00
|
|
|
tvb, dest_addr_offset, dest_addr_length,
|
2017-03-05 19:52:16 +00:00
|
|
|
ENC_NA);
|
2006-10-05 14:10:10 +00:00
|
|
|
PROTO_ITEM_SET_HIDDEN(addr_ti);
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
if (dest_port_offset != 0) {
|
2006-10-05 14:10:10 +00:00
|
|
|
proto_item *port_ti;
|
2007-06-15 17:21:13 +00:00
|
|
|
|
|
|
|
pinfo->destport = tvb_get_ntohs(tvb, dest_port_offset);
|
|
|
|
|
2006-11-30 11:36:28 +00:00
|
|
|
proto_tree_add_item(ipprim_tree,
|
2006-10-05 14:10:10 +00:00
|
|
|
(type_of_port == PT_UDP) ?
|
|
|
|
hf_catapult_dct2000_ipprim_udp_dst_port :
|
|
|
|
hf_catapult_dct2000_ipprim_tcp_dst_port,
|
2011-10-26 18:11:24 +00:00
|
|
|
tvb, dest_port_offset, 2, ENC_BIG_ENDIAN);
|
2006-11-30 11:36:28 +00:00
|
|
|
port_ti = proto_tree_add_item(ipprim_tree,
|
2006-10-05 14:10:10 +00:00
|
|
|
(type_of_port == PT_UDP) ?
|
|
|
|
hf_catapult_dct2000_ipprim_udp_port :
|
|
|
|
hf_catapult_dct2000_ipprim_tcp_port,
|
2011-10-26 18:11:24 +00:00
|
|
|
tvb, dest_port_offset, 2, ENC_BIG_ENDIAN);
|
2006-10-05 14:10:10 +00:00
|
|
|
PROTO_ITEM_SET_HIDDEN(port_ti);
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
if (conn_id_offset != 0) {
|
2007-04-11 14:34:56 +00:00
|
|
|
proto_tree_add_item(ipprim_tree,
|
|
|
|
hf_catapult_dct2000_ipprim_conn_id,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, conn_id_offset, 2, ENC_BIG_ENDIAN);
|
2007-04-11 14:34:56 +00:00
|
|
|
}
|
2006-11-30 11:36:28 +00:00
|
|
|
|
2007-06-15 17:21:13 +00:00
|
|
|
|
|
|
|
/* Set source and dest columns now (will be overwriiten if
|
|
|
|
src and dst IP addresses set) */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (source_addr_offset) {
|
2007-06-15 17:21:13 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_DEF_SRC,
|
|
|
|
"(%s:%u)",
|
2010-02-27 01:12:24 +00:00
|
|
|
get_hostname(tvb_get_ipv4(tvb, source_addr_offset)),
|
2007-06-15 17:21:13 +00:00
|
|
|
tvb_get_ntohs(tvb, source_port_offset));
|
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
if (dest_addr_offset) {
|
2007-06-15 17:21:13 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_DEF_DST,
|
|
|
|
"(%s:%u)",
|
2010-02-27 01:12:24 +00:00
|
|
|
get_hostname(tvb_get_ipv4(tvb, dest_addr_offset)),
|
2007-06-15 17:21:13 +00:00
|
|
|
tvb_get_ntohs(tvb, dest_port_offset));
|
|
|
|
}
|
|
|
|
|
2006-11-30 11:36:28 +00:00
|
|
|
/* Set length for IPPrim tree */
|
|
|
|
proto_item_set_len(ipprim_tree, offset - offset_before_ipprim_header);
|
2006-08-02 09:30:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-04-11 14:34:56 +00:00
|
|
|
|
2006-08-02 09:30:28 +00:00
|
|
|
/* Try SCTP Prim heuristic if configured to */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (!protocol_handle && catapult_dct2000_try_sctpprim_heuristic) {
|
2008-01-16 14:19:45 +00:00
|
|
|
guint32 dest_addr_offset = 0;
|
2008-01-16 20:49:50 +00:00
|
|
|
guint16 dest_addr_length = 0;
|
2008-01-16 14:19:45 +00:00
|
|
|
guint32 dest_port_offset = 0;
|
|
|
|
int offset_before_sctpprim_header = offset;
|
|
|
|
|
2006-09-04 11:04:14 +00:00
|
|
|
heur_protocol_handle = look_for_dissector(protocol_name);
|
2006-08-02 09:30:28 +00:00
|
|
|
if ((heur_protocol_handle != 0) &&
|
2008-01-16 14:19:45 +00:00
|
|
|
(find_sctpprim_variant1_data_offset(tvb, &offset,
|
|
|
|
&dest_addr_offset,
|
|
|
|
&dest_addr_length,
|
|
|
|
&dest_port_offset) ||
|
|
|
|
find_sctpprim_variant3_data_offset(tvb, &offset,
|
|
|
|
&dest_addr_offset,
|
|
|
|
&dest_addr_length,
|
2009-07-13 10:55:53 +00:00
|
|
|
&dest_port_offset))) {
|
|
|
|
|
2008-01-16 14:19:45 +00:00
|
|
|
proto_tree *sctpprim_tree;
|
2008-06-27 04:52:56 +00:00
|
|
|
proto_item *ti_local;
|
2008-01-16 14:19:45 +00:00
|
|
|
|
2007-11-02 22:34:18 +00:00
|
|
|
/* Will use this dissector then. */
|
2006-08-02 09:30:28 +00:00
|
|
|
protocol_handle = heur_protocol_handle;
|
2008-01-16 14:19:45 +00:00
|
|
|
|
2008-06-27 04:52:56 +00:00
|
|
|
ti_local = proto_tree_add_string_format(dct2000_tree, hf_catapult_dct2000_sctpprim_addresses,
|
2008-01-16 14:19:45 +00:00
|
|
|
tvb, offset_before_sctpprim_header, 0,
|
|
|
|
"", "SCTPPrim transport: -> %s:%u",
|
|
|
|
(dest_addr_offset) ?
|
|
|
|
((dest_addr_length == 4) ?
|
2010-02-27 01:12:24 +00:00
|
|
|
get_hostname(tvb_get_ipv4(tvb, dest_addr_offset)) :
|
2008-01-16 14:19:45 +00:00
|
|
|
"<ipv6-address>"
|
|
|
|
) :
|
|
|
|
"0.0.0.0",
|
|
|
|
(dest_port_offset) ?
|
|
|
|
tvb_get_ntohs(tvb, dest_port_offset) :
|
|
|
|
0);
|
|
|
|
|
|
|
|
/* Add these SCTPPRIM fields inside an SCTPPRIM subtree */
|
2008-06-27 04:52:56 +00:00
|
|
|
sctpprim_tree = proto_item_add_subtree(ti_local, ett_catapult_dct2000_sctpprim);
|
2008-01-16 14:19:45 +00:00
|
|
|
|
|
|
|
/* Destination address */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (dest_addr_offset != 0) {
|
2008-01-16 14:19:45 +00:00
|
|
|
proto_item *addr_ti;
|
|
|
|
|
2015-10-29 03:12:53 +00:00
|
|
|
set_address_tvb(&pinfo->net_dst,
|
2008-01-16 14:19:45 +00:00
|
|
|
(dest_addr_length == 4) ? AT_IPv4 : AT_IPv6,
|
2015-10-29 03:12:53 +00:00
|
|
|
dest_addr_length, tvb, dest_addr_offset);
|
2015-10-21 19:04:16 +00:00
|
|
|
copy_address_shallow(&pinfo->dst, &pinfo->net_dst);
|
2008-01-16 14:19:45 +00:00
|
|
|
proto_tree_add_item(sctpprim_tree,
|
2010-09-23 21:46:31 +00:00
|
|
|
(dest_addr_length == 4) ?
|
2008-01-16 14:19:45 +00:00
|
|
|
hf_catapult_dct2000_sctpprim_dst_addr_v4 :
|
|
|
|
hf_catapult_dct2000_sctpprim_dst_addr_v6,
|
2011-10-26 18:11:24 +00:00
|
|
|
tvb, dest_addr_offset, dest_addr_length,
|
2017-03-05 19:52:16 +00:00
|
|
|
ENC_NA);
|
2008-01-16 14:19:45 +00:00
|
|
|
|
|
|
|
/* Add hidden item for "side-less" addr */
|
|
|
|
addr_ti = proto_tree_add_item(sctpprim_tree,
|
2010-09-23 21:46:31 +00:00
|
|
|
(dest_addr_length == 4) ?
|
2008-01-16 14:19:45 +00:00
|
|
|
hf_catapult_dct2000_sctpprim_addr_v4 :
|
|
|
|
hf_catapult_dct2000_sctpprim_addr_v6,
|
2011-10-26 18:11:24 +00:00
|
|
|
tvb, dest_addr_offset, dest_addr_length,
|
2017-03-05 19:52:16 +00:00
|
|
|
ENC_NA);
|
2008-01-16 14:19:45 +00:00
|
|
|
PROTO_ITEM_SET_HIDDEN(addr_ti);
|
|
|
|
}
|
|
|
|
|
2009-07-13 10:55:53 +00:00
|
|
|
if (dest_port_offset != 0) {
|
2008-01-16 14:19:45 +00:00
|
|
|
pinfo->destport = tvb_get_ntohs(tvb, dest_port_offset);
|
|
|
|
|
|
|
|
proto_tree_add_item(sctpprim_tree,
|
|
|
|
hf_catapult_dct2000_sctpprim_dst_port,
|
2011-10-06 03:35:44 +00:00
|
|
|
tvb, dest_port_offset, 2, ENC_BIG_ENDIAN);
|
2008-01-16 14:19:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Set length for SCTPPrim tree */
|
|
|
|
proto_item_set_len(sctpprim_tree, offset - offset_before_sctpprim_header);
|
2006-05-23 05:48:00 +00:00
|
|
|
}
|
|
|
|
}
|
2006-08-02 09:30:28 +00:00
|
|
|
|
2011-05-11 11:10:30 +00:00
|
|
|
/* Last chance: is there a (private) registered protocol of the form
|
|
|
|
"dct2000.protocol" ? */
|
2011-03-15 17:30:00 +00:00
|
|
|
if (protocol_handle == 0) {
|
|
|
|
/* TODO: only look inside preference? */
|
|
|
|
char dotted_protocol_name[64+128];
|
2011-03-15 22:55:53 +00:00
|
|
|
g_snprintf(dotted_protocol_name, 64+128, "dct2000.%s", protocol_name);
|
2011-03-15 17:30:00 +00:00
|
|
|
protocol_handle = find_dissector(dotted_protocol_name);
|
|
|
|
}
|
|
|
|
|
2006-04-14 13:12:13 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* !! If get here, there is a mismatch between
|
|
|
|
this dissector and the wiretap module catapult_dct2000.c !!
|
|
|
|
*/
|
|
|
|
DISSECTOR_ASSERT_NOT_REACHED();
|
2015-11-10 04:01:28 +00:00
|
|
|
return 0;
|
2006-04-14 13:12:13 +00:00
|
|
|
}
|
|
|
|
|
2010-08-25 13:27:27 +00:00
|
|
|
/* Set selection length of dct2000 tree */
|
|
|
|
proto_item_set_len(dct2000_tree, offset);
|
2006-04-14 13:12:13 +00:00
|
|
|
|
2008-02-03 23:04:04 +00:00
|
|
|
/* Try appropriate dissector, if one has been selected */
|
2009-07-13 10:55:53 +00:00
|
|
|
if (protocol_handle != 0) {
|
2006-04-14 13:12:13 +00:00
|
|
|
/* Dissect the remainder of the frame using chosen protocol handle */
|
2013-02-19 23:17:07 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset);
|
2016-01-14 00:03:26 +00:00
|
|
|
sub_dissector_result = call_dissector_only(protocol_handle, next_tvb, pinfo, tree, protocol_data);
|
2006-04-14 13:12:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-07-13 10:55:53 +00:00
|
|
|
if (protocol_handle == 0 || sub_dissector_result == 0) {
|
2006-04-14 13:12:13 +00:00
|
|
|
/* Could get here because:
|
2007-11-02 22:34:18 +00:00
|
|
|
- encap is DCT2000_ENCAP_UNHANDLED and we still didn't handle it, OR
|
2006-04-14 13:12:13 +00:00
|
|
|
- desired protocol is unavailable (probably disabled), OR
|
|
|
|
- protocol rejected our data
|
|
|
|
Show remaining bytes as unparsed data */
|
|
|
|
proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_unparsed_data,
|
2011-10-04 22:44:31 +00:00
|
|
|
tvb, offset, -1, ENC_NA);
|
2006-10-05 14:10:10 +00:00
|
|
|
|
2009-07-13 10:55:53 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO,
|
|
|
|
"Not dissected (context=%s.%u t=%s %c prot=%s (v=%s))",
|
2011-01-12 02:25:08 +00:00
|
|
|
context_name,
|
2009-07-13 10:55:53 +00:00
|
|
|
port_number,
|
2011-01-12 02:25:08 +00:00
|
|
|
timestamp_string,
|
2009-07-13 10:55:53 +00:00
|
|
|
(direction == 0) ? 'S' : 'R',
|
2011-01-12 02:25:08 +00:00
|
|
|
protocol_name,
|
|
|
|
variant_string);
|
2006-04-14 13:12:13 +00:00
|
|
|
}
|
2009-07-13 10:55:53 +00:00
|
|
|
else {
|
2006-12-21 18:00:07 +00:00
|
|
|
/* Show number of dissected bytes */
|
2008-02-03 23:04:04 +00:00
|
|
|
if (dct2000_tree) {
|
2008-06-27 04:52:56 +00:00
|
|
|
proto_item *ti_local = proto_tree_add_uint(dct2000_tree,
|
2008-02-03 23:04:04 +00:00
|
|
|
hf_catapult_dct2000_dissected_length,
|
|
|
|
tvb, 0, 0, tvb_reported_length(tvb)-offset);
|
2008-06-27 04:52:56 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(ti_local);
|
2008-02-03 23:04:04 +00:00
|
|
|
}
|
2006-12-21 18:00:07 +00:00
|
|
|
}
|
2015-11-10 04:01:28 +00:00
|
|
|
|
|
|
|
return tvb_captured_length(tvb);
|
2006-04-14 13:12:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/* Associate this protocol with the Catapult DCT2000 file encapsulation type. */
|
|
|
|
/******************************************************************************/
|
|
|
|
void proto_reg_handoff_catapult_dct2000(void)
|
|
|
|
{
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("wtap_encap", WTAP_ENCAP_CATAPULT_DCT2000, catapult_dct2000_handle);
|
2009-04-18 08:03:09 +00:00
|
|
|
|
2009-05-26 16:01:12 +00:00
|
|
|
mac_lte_handle = find_dissector("mac-lte");
|
|
|
|
rlc_lte_handle = find_dissector("rlc-lte");
|
|
|
|
pdcp_lte_handle = find_dissector("pdcp-lte");
|
2006-04-14 13:12:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************/
|
|
|
|
/* Register the protocol */
|
|
|
|
/****************************************/
|
|
|
|
void proto_register_catapult_dct2000(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] =
|
|
|
|
{
|
|
|
|
{ &hf_catapult_dct2000_context,
|
|
|
|
{ "Context",
|
|
|
|
"dct2000.context", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Context name", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_port_number,
|
|
|
|
{ "Context Port number",
|
|
|
|
"dct2000.context_port", FT_UINT8, BASE_DEC, NULL, 0x0,
|
2009-05-26 16:01:12 +00:00
|
|
|
NULL, HFILL
|
2006-04-14 13:12:13 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_timestamp,
|
|
|
|
{ "Timestamp",
|
2009-07-07 09:02:59 +00:00
|
|
|
"dct2000.timestamp", FT_DOUBLE, BASE_NONE, NULL, 0x0,
|
2006-04-14 13:12:13 +00:00
|
|
|
"File timestamp", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_protocol,
|
|
|
|
{ "DCT2000 protocol",
|
|
|
|
"dct2000.protocol", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Original (DCT2000) protocol name", HFILL
|
|
|
|
}
|
|
|
|
},
|
2006-05-23 05:48:00 +00:00
|
|
|
{ &hf_catapult_dct2000_variant,
|
|
|
|
{ "Protocol variant",
|
2006-06-11 08:26:55 +00:00
|
|
|
"dct2000.variant", FT_STRING, BASE_NONE, NULL, 0x0,
|
2006-05-23 05:48:00 +00:00
|
|
|
"DCT2000 protocol variant", HFILL
|
|
|
|
}
|
|
|
|
},
|
2006-08-02 09:30:28 +00:00
|
|
|
{ &hf_catapult_dct2000_outhdr,
|
|
|
|
{ "Out-header",
|
|
|
|
"dct2000.outhdr", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"DCT2000 protocol outhdr", HFILL
|
|
|
|
}
|
|
|
|
},
|
2006-04-14 13:12:13 +00:00
|
|
|
{ &hf_catapult_dct2000_direction,
|
|
|
|
{ "Direction",
|
|
|
|
"dct2000.direction", FT_UINT8, BASE_DEC, VALS(direction_vals), 0x0,
|
|
|
|
"Frame direction (Sent or Received)", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_encap,
|
2006-05-21 04:49:01 +00:00
|
|
|
{ "Wireshark encapsulation",
|
2006-04-14 13:12:13 +00:00
|
|
|
"dct2000.encapsulation", FT_UINT8, BASE_DEC, VALS(encap_vals), 0x0,
|
2007-11-02 22:34:18 +00:00
|
|
|
"Wireshark frame encapsulation used", HFILL
|
2006-04-14 13:12:13 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_unparsed_data,
|
|
|
|
{ "Unparsed protocol data",
|
|
|
|
"dct2000.unparsed_data", FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
"Unparsed DCT2000 protocol data", HFILL
|
|
|
|
}
|
|
|
|
},
|
2009-10-26 00:04:27 +00:00
|
|
|
{ &hf_catapult_dct2000_comment,
|
|
|
|
{ "Comment",
|
|
|
|
"dct2000.comment", FT_STRING, BASE_NONE, NULL, 0x0,
|
2010-09-23 21:46:31 +00:00
|
|
|
NULL, HFILL
|
2009-10-26 00:04:27 +00:00
|
|
|
}
|
|
|
|
},
|
2013-02-15 23:43:30 +00:00
|
|
|
{ &hf_catapult_dct2000_sprint,
|
|
|
|
{ "Sprint text",
|
|
|
|
"dct2000.sprint", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
2010-05-25 14:02:17 +00:00
|
|
|
{ &hf_catapult_dct2000_error_comment,
|
|
|
|
{ "Error comment",
|
|
|
|
"dct2000.error-comment", FT_NONE, BASE_NONE, NULL, 0x0,
|
2010-09-23 21:46:31 +00:00
|
|
|
NULL, HFILL
|
2010-05-25 14:02:17 +00:00
|
|
|
}
|
|
|
|
},
|
2006-12-21 18:00:07 +00:00
|
|
|
{ &hf_catapult_dct2000_dissected_length,
|
|
|
|
{ "Dissected length",
|
|
|
|
"dct2000.dissected-length", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Number of bytes dissected by subdissector(s)", HFILL
|
|
|
|
}
|
|
|
|
},
|
2008-01-16 14:19:45 +00:00
|
|
|
|
2006-10-05 14:10:10 +00:00
|
|
|
{ &hf_catapult_dct2000_ipprim_addresses,
|
|
|
|
{ "IPPrim Addresses",
|
|
|
|
"dct2000.ipprim", FT_STRING, BASE_NONE, NULL, 0x0,
|
2009-05-26 16:01:12 +00:00
|
|
|
NULL, HFILL
|
2006-10-05 14:10:10 +00:00
|
|
|
}
|
|
|
|
},
|
2007-09-28 16:17:22 +00:00
|
|
|
{ &hf_catapult_dct2000_ipprim_src_addr_v4,
|
2006-10-05 14:10:10 +00:00
|
|
|
{ "Source Address",
|
|
|
|
"dct2000.ipprim.src", FT_IPv4, BASE_NONE, NULL, 0x0,
|
2007-09-28 16:17:22 +00:00
|
|
|
"IPPrim IPv4 Source Address", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_ipprim_src_addr_v6,
|
|
|
|
{ "Source Address",
|
|
|
|
"dct2000.ipprim.srcv6", FT_IPv6, BASE_NONE, NULL, 0x0,
|
|
|
|
"IPPrim IPv6 Source Address", HFILL
|
2006-10-05 14:10:10 +00:00
|
|
|
}
|
|
|
|
},
|
2007-09-28 16:17:22 +00:00
|
|
|
{ &hf_catapult_dct2000_ipprim_dst_addr_v4,
|
2006-10-05 14:10:10 +00:00
|
|
|
{ "Destination Address",
|
|
|
|
"dct2000.ipprim.dst", FT_IPv4, BASE_NONE, NULL, 0x0,
|
2007-09-28 16:17:22 +00:00
|
|
|
"IPPrim IPv4 Destination Address", HFILL
|
2006-10-05 14:10:10 +00:00
|
|
|
}
|
|
|
|
},
|
2007-09-28 16:17:22 +00:00
|
|
|
{ &hf_catapult_dct2000_ipprim_dst_addr_v6,
|
|
|
|
{ "Destination Address",
|
|
|
|
"dct2000.ipprim.dstv6", FT_IPv6, BASE_NONE, NULL, 0x0,
|
|
|
|
"IPPrim IPv6 Destination Address", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_ipprim_addr_v4,
|
2006-10-05 14:10:10 +00:00
|
|
|
{ "Address",
|
|
|
|
"dct2000.ipprim.addr", FT_IPv4, BASE_NONE, NULL, 0x0,
|
2007-11-02 22:34:18 +00:00
|
|
|
"IPPrim IPv4 Address", HFILL
|
2007-09-28 16:17:22 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_ipprim_addr_v6,
|
|
|
|
{ "Address",
|
|
|
|
"dct2000.ipprim.addrv6", FT_IPv6, BASE_NONE, NULL, 0x0,
|
2007-11-02 22:34:18 +00:00
|
|
|
"IPPrim IPv6 Address", HFILL
|
2006-10-05 14:10:10 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_ipprim_udp_src_port,
|
|
|
|
{ "UDP Source Port",
|
|
|
|
"dct2000.ipprim.udp.srcport", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"IPPrim UDP Source Port", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_ipprim_udp_dst_port,
|
|
|
|
{ "UDP Destination Port",
|
|
|
|
"dct2000.ipprim.udp.dstport", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"IPPrim UDP Destination Port", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_ipprim_udp_port,
|
|
|
|
{ "UDP Port",
|
|
|
|
"dct2000.ipprim.udp.port", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"IPPrim UDP Port", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_ipprim_tcp_src_port,
|
|
|
|
{ "TCP Source Port",
|
|
|
|
"dct2000.ipprim.tcp.srcport", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"IPPrim TCP Source Port", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_ipprim_tcp_dst_port,
|
|
|
|
{ "TCP Destination Port",
|
|
|
|
"dct2000.ipprim.tcp.dstport", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"IPPrim TCP Destination Port", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_ipprim_tcp_port,
|
|
|
|
{ "TCP Port",
|
|
|
|
"dct2000.ipprim.tcp.port", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"IPPrim TCP Port", HFILL
|
|
|
|
}
|
2007-04-11 14:34:56 +00:00
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_ipprim_conn_id,
|
|
|
|
{ "Conn Id",
|
|
|
|
"dct2000.ipprim.conn-id", FT_UINT16, BASE_DEC, NULL, 0x0,
|
2008-02-03 23:04:04 +00:00
|
|
|
"IPPrim TCP Connection ID", HFILL
|
2007-04-11 14:34:56 +00:00
|
|
|
}
|
2007-09-17 16:03:49 +00:00
|
|
|
},
|
2008-01-16 14:19:45 +00:00
|
|
|
|
|
|
|
{ &hf_catapult_dct2000_sctpprim_addresses,
|
|
|
|
{ "SCTPPrim Addresses",
|
|
|
|
"dct2000.sctpprim", FT_STRING, BASE_NONE, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL
|
2008-01-16 14:19:45 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_sctpprim_dst_addr_v4,
|
|
|
|
{ "Destination Address",
|
|
|
|
"dct2000.sctpprim.dst", FT_IPv4, BASE_NONE, NULL, 0x0,
|
|
|
|
"SCTPPrim IPv4 Destination Address", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_sctpprim_dst_addr_v6,
|
|
|
|
{ "Destination Address",
|
|
|
|
"dct2000.sctpprim.dstv6", FT_IPv6, BASE_NONE, NULL, 0x0,
|
|
|
|
"SCTPPrim IPv6 Destination Address", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_sctpprim_addr_v4,
|
|
|
|
{ "Address",
|
|
|
|
"dct2000.sctpprim.addr", FT_IPv4, BASE_NONE, NULL, 0x0,
|
|
|
|
"SCTPPrim IPv4 Address", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_sctpprim_addr_v6,
|
|
|
|
{ "Address",
|
|
|
|
"dct2000.sctpprim.addrv6", FT_IPv6, BASE_NONE, NULL, 0x0,
|
|
|
|
"SCTPPrim IPv6 Address", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_sctpprim_dst_port,
|
|
|
|
{ "UDP Destination Port",
|
|
|
|
"dct2000.sctprim.dstport", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"SCTPPrim Destination Port", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2007-09-17 16:03:49 +00:00
|
|
|
{ &hf_catapult_dct2000_tty,
|
|
|
|
{ "tty contents",
|
|
|
|
"dct2000.tty", FT_NONE, BASE_NONE, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL
|
2007-09-17 16:03:49 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_tty_line,
|
|
|
|
{ "tty line",
|
|
|
|
"dct2000.tty-line", FT_STRING, BASE_NONE, NULL, 0x0,
|
2009-05-26 16:01:12 +00:00
|
|
|
NULL, HFILL
|
2007-09-17 16:03:49 +00:00
|
|
|
}
|
|
|
|
},
|
2009-01-02 01:37:55 +00:00
|
|
|
|
|
|
|
{ &hf_catapult_dct2000_lte_ueid,
|
|
|
|
{ "UE Id",
|
|
|
|
"dct2000.lte.ueid", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"User Equipment Identifier", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_lte_srbid,
|
|
|
|
{ "srbid",
|
|
|
|
"dct2000.lte.srbid", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"Signalling Radio Bearer Identifier", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_lte_drbid,
|
|
|
|
{ "drbid",
|
|
|
|
"dct2000.lte.drbid", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"Data Radio Bearer Identifier", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_lte_cellid,
|
|
|
|
{ "Cell-Id",
|
|
|
|
"dct2000.lte.cellid", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Cell Identifier", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_lte_bcch_transport,
|
|
|
|
{ "BCCH Transport",
|
|
|
|
"dct2000.lte.bcch-transport", FT_UINT16, BASE_DEC, VALS(bcch_transport_vals), 0x0,
|
|
|
|
"BCCH Transport Channel", HFILL
|
|
|
|
}
|
|
|
|
},
|
2009-01-23 15:58:33 +00:00
|
|
|
{ &hf_catapult_dct2000_lte_rlc_op,
|
|
|
|
{ "RLC Op",
|
|
|
|
"dct2000.lte.rlc-op", FT_UINT8, BASE_DEC, VALS(rlc_op_vals), 0x0,
|
|
|
|
"RLC top-level op", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_lte_rlc_channel_type,
|
|
|
|
{ "RLC Logical Channel Type",
|
|
|
|
"dct2000.lte.rlc-logchan-type", FT_UINT8, BASE_DEC, VALS(rlc_logical_channel_vals), 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL
|
2009-01-23 15:58:33 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_lte_rlc_mui,
|
|
|
|
{ "MUI",
|
|
|
|
"dct2000.lte.rlc-mui", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"RLC MUI", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_lte_rlc_cnf,
|
|
|
|
{ "CNF",
|
2009-05-11 15:19:51 +00:00
|
|
|
"dct2000.lte.rlc-cnf", FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0,
|
2009-01-23 15:58:33 +00:00
|
|
|
"RLC CNF", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_lte_rlc_discard_req,
|
|
|
|
{ "Discard Req",
|
2009-05-11 15:19:51 +00:00
|
|
|
"dct2000.lte.rlc-discard-req", FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0,
|
2009-01-23 15:58:33 +00:00
|
|
|
"RLC Discard Req", HFILL
|
|
|
|
}
|
|
|
|
},
|
2009-12-29 22:57:10 +00:00
|
|
|
|
|
|
|
{ &hf_catapult_dct2000_lte_ccpri_opcode,
|
|
|
|
{ "CCPRI opcode",
|
|
|
|
"dct2000.lte.ccpri.opcode", FT_UINT8, BASE_DEC, VALS(ccpri_opcode_vals), 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_lte_ccpri_status,
|
|
|
|
{ "Status",
|
|
|
|
"dct2000.lte.ccpri.status", FT_UINT8, BASE_DEC, VALS(ccpri_status_vals), 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_lte_ccpri_channel,
|
|
|
|
{ "Channel",
|
|
|
|
"dct2000.lte.ccpri.channel", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2012-03-29 01:24:49 +00:00
|
|
|
{ &hf_catapult_dct2000_lte_nas_rrc_opcode,
|
|
|
|
{ "NAS RRC Opcode",
|
|
|
|
"dct2000.lte.nas-rrc.opcode", FT_UINT8, BASE_DEC, VALS(lte_nas_rrc_opcode_vals), 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_lte_nas_rrc_establish_cause,
|
|
|
|
{ "Establish Cause",
|
|
|
|
"dct2000.lte.nas-rrc.establish-cause", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_lte_nas_rrc_priority,
|
|
|
|
{ "Priority",
|
|
|
|
"dct2000.lte.nas-rrc.priority", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_lte_nas_rrc_release_cause,
|
|
|
|
{ "Priority",
|
|
|
|
"dct2000.lte.nas-rrc.priority", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
|
2011-11-03 16:52:37 +00:00
|
|
|
{ &hf_catapult_dct2000_ueid,
|
|
|
|
{ "UE Id",
|
|
|
|
"dct2000.ueid", FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"User Equipment Identifier", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_rbid,
|
|
|
|
{ "Channel",
|
2014-08-14 18:25:40 +00:00
|
|
|
"dct2000.rbid", FT_UINT8, BASE_DEC | BASE_EXT_STRING, &rlc_rbid_vals_ext, 0x0,
|
2011-11-03 16:52:37 +00:00
|
|
|
"Channel (rbid)", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_ccch_id,
|
|
|
|
{ "CCCH Id",
|
|
|
|
"dct2000.ccch-id", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"CCCH Identifier", HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_no_crc_error,
|
|
|
|
{ "No CRC Error",
|
|
|
|
"dct2000.no-crc-error", FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_crc_error,
|
|
|
|
{ "CRC Error",
|
|
|
|
"dct2000.crc-error", FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_clear_tx_buffer,
|
|
|
|
{ "Clear Tx Buffer",
|
|
|
|
"dct2000.clear-tx-buffer", FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
2011-11-14 12:22:54 +00:00
|
|
|
{ &hf_catapult_dct2000_buffer_occupancy,
|
|
|
|
{ "Buffer Occupancy",
|
|
|
|
"dct2000.buffer-occupancy", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_pdu_size,
|
|
|
|
{ "PDU Size",
|
|
|
|
"dct2000.pdu-size", FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_ueid_type,
|
|
|
|
{ "UEId Type",
|
|
|
|
"dct2000.ueid-type", FT_UINT8, BASE_DEC, VALS(ueid_type_vals), 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_tx_priority,
|
|
|
|
{ "Tx Priority",
|
|
|
|
"dct2000.tx-priority", FT_UINT8, BASE_DEC, VALS(tx_priority_vals), 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_last_in_seg_set,
|
|
|
|
{ "Last in seg set",
|
2012-03-16 02:00:29 +00:00
|
|
|
"dct2000.last-in-seg-set", FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0x0,
|
2011-11-14 12:22:54 +00:00
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_rx_timing_deviation,
|
|
|
|
{ "Tx Timing Deviation",
|
|
|
|
"dct2000.rx-timing-deviation", FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_transport_channel_type,
|
|
|
|
{ "Transport Channel Type",
|
|
|
|
"dct2000.transport_channel_type", FT_UINT8, BASE_DEC, VALS(transport_channel_type_vals), 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ &hf_catapult_dct2000_no_padding_bits,
|
|
|
|
{ "Number of padding bits",
|
|
|
|
"dct2000.number-of-padding-bits", FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
2011-11-03 16:52:37 +00:00
|
|
|
|
2006-04-14 13:12:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett[] =
|
|
|
|
{
|
2006-10-05 14:10:10 +00:00
|
|
|
&ett_catapult_dct2000,
|
2007-09-17 16:03:49 +00:00
|
|
|
&ett_catapult_dct2000_ipprim,
|
2008-01-16 14:19:45 +00:00
|
|
|
&ett_catapult_dct2000_sctpprim,
|
2007-09-17 16:03:49 +00:00
|
|
|
&ett_catapult_dct2000_tty
|
2006-04-14 13:12:13 +00:00
|
|
|
};
|
|
|
|
|
2013-05-25 17:06:40 +00:00
|
|
|
static ei_register_info ei[] = {
|
|
|
|
{ &ei_catapult_dct2000_lte_ccpri_status_error, { "dct2000.lte.ccpri.status.error", PI_SEQUENCE, PI_ERROR, "CCPRI Indication has error status", EXPFILL }},
|
|
|
|
{ &ei_catapult_dct2000_error_comment_expert, { "dct2000.error-comment.expert", PI_SEQUENCE, PI_ERROR, "Formatted expert comment", EXPFILL }},
|
2016-10-22 18:59:44 +00:00
|
|
|
{ &ei_catapult_dct2000_string_invalid, { "dct2000.string.invalid", PI_MALFORMED, PI_ERROR, "String must contain an integer", EXPFILL }}
|
2013-05-25 17:06:40 +00:00
|
|
|
};
|
|
|
|
|
2006-04-14 13:12:13 +00:00
|
|
|
module_t *catapult_dct2000_module;
|
2013-05-25 17:06:40 +00:00
|
|
|
expert_module_t* expert_catapult_dct2000;
|
2006-11-09 16:35:12 +00:00
|
|
|
|
2006-04-14 13:12:13 +00:00
|
|
|
/* Register protocol. */
|
2006-11-09 16:35:12 +00:00
|
|
|
proto_catapult_dct2000 = proto_register_protocol("Catapult DCT2000 packet",
|
|
|
|
"DCT2000",
|
|
|
|
"dct2000");
|
2006-04-14 13:12:13 +00:00
|
|
|
proto_register_field_array(proto_catapult_dct2000, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2013-05-25 17:06:40 +00:00
|
|
|
expert_catapult_dct2000 = expert_register_protocol(proto_catapult_dct2000);
|
|
|
|
expert_register_field_array(expert_catapult_dct2000, ei, array_length(ei));
|
2006-04-14 13:12:13 +00:00
|
|
|
|
|
|
|
/* Allow dissector to find be found by name. */
|
2016-12-17 01:06:11 +00:00
|
|
|
catapult_dct2000_handle = register_dissector("dct2000", dissect_catapult_dct2000, proto_catapult_dct2000);
|
2006-04-14 13:12:13 +00:00
|
|
|
|
|
|
|
/* Preferences */
|
2008-08-25 17:26:26 +00:00
|
|
|
catapult_dct2000_module = prefs_register_protocol(proto_catapult_dct2000, NULL);
|
2006-04-14 13:12:13 +00:00
|
|
|
|
2006-08-02 09:30:28 +00:00
|
|
|
/* This preference no longer supported (introduces linkage dependency between
|
2007-12-03 15:47:08 +00:00
|
|
|
dissectors and wiretap) */
|
2006-08-02 09:30:28 +00:00
|
|
|
prefs_register_obsolete_preference(catapult_dct2000_module, "board_ports_only");
|
2006-05-23 05:48:00 +00:00
|
|
|
|
|
|
|
/* Determines whether for not-handled protocols we should try to parse it if:
|
2013-02-26 01:06:19 +00:00
|
|
|
- it looks like it's embedded in an ipprim message, AND
|
2008-12-18 19:08:49 +00:00
|
|
|
- the DCT2000 protocol name can be matched to a Wireshark dissector name */
|
2006-05-23 05:48:00 +00:00
|
|
|
prefs_register_bool_preference(catapult_dct2000_module, "ipprim_heuristic",
|
|
|
|
"Use IP Primitive heuristic",
|
2013-02-26 01:06:19 +00:00
|
|
|
"If a payload looks like it's embedded in an "
|
2008-12-18 19:08:49 +00:00
|
|
|
"IP primitive message, and there is a Wireshark "
|
2006-05-23 05:48:00 +00:00
|
|
|
"dissector matching the DCT2000 protocol name, "
|
|
|
|
"try parsing the payload using that dissector",
|
|
|
|
&catapult_dct2000_try_ipprim_heuristic);
|
2006-08-02 09:30:28 +00:00
|
|
|
|
|
|
|
/* Determines whether for not-handled protocols we should try to parse it if:
|
2013-02-26 01:06:19 +00:00
|
|
|
- it looks like it's embedded in an sctpprim message, AND
|
2008-12-18 19:08:49 +00:00
|
|
|
- the DCT2000 protocol name can be matched to a Wireshark dissector name */
|
2006-08-02 09:30:28 +00:00
|
|
|
prefs_register_bool_preference(catapult_dct2000_module, "sctpprim_heuristic",
|
|
|
|
"Use SCTP Primitive heuristic",
|
2013-02-26 01:06:19 +00:00
|
|
|
"If a payload looks like it's embedded in an "
|
2008-12-18 19:08:49 +00:00
|
|
|
"SCTP primitive message, and there is a Wireshark "
|
2006-08-02 09:30:28 +00:00
|
|
|
"dissector matching the DCT2000 protocol name, "
|
|
|
|
"try parsing the payload using that dissector",
|
|
|
|
&catapult_dct2000_try_sctpprim_heuristic);
|
2009-07-07 14:38:14 +00:00
|
|
|
|
|
|
|
/* Determines whether LTE RRC messages should be dissected */
|
|
|
|
prefs_register_bool_preference(catapult_dct2000_module, "decode_lte_rrc",
|
|
|
|
"Attempt to decode LTE RRC frames",
|
|
|
|
"When set, attempt to decode LTE RRC frames. "
|
|
|
|
"Note that this won't affect other protocols "
|
|
|
|
"that also call the LTE RRC dissector",
|
|
|
|
&catapult_dct2000_dissect_lte_rrc);
|
2009-08-15 01:29:29 +00:00
|
|
|
|
|
|
|
/* Determines whether LTE S1AP messages should be dissected */
|
|
|
|
prefs_register_bool_preference(catapult_dct2000_module, "decode_lte_s1ap",
|
|
|
|
"Attempt to decode LTE S1AP frames",
|
|
|
|
"When set, attempt to decode LTE S1AP frames. "
|
|
|
|
"Note that this won't affect other protocols "
|
|
|
|
"that also call the LTE S1AP dissector",
|
|
|
|
&catapult_dct2000_dissect_lte_s1ap);
|
2009-10-26 16:40:57 +00:00
|
|
|
|
|
|
|
/* Determines whether out-of-band messages should dissected */
|
|
|
|
prefs_register_bool_preference(catapult_dct2000_module, "decode_mac_lte_oob_messages",
|
|
|
|
"Look for out-of-band LTE MAC events messages in comments",
|
|
|
|
"When set, look for formatted messages indicating "
|
|
|
|
"specific events. This may be quite slow, so should "
|
|
|
|
"be disabled if LTE MAC is not being analysed",
|
|
|
|
&catapult_dct2000_dissect_mac_lte_oob_messages);
|
2006-04-14 13:12:13 +00:00
|
|
|
}
|
|
|
|
|
2014-08-14 18:25:40 +00:00
|
|
|
/*
|
|
|
|
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|