2009-07-31 19:19:25 +00:00
|
|
|
/* packet-gsm_ipa.c
|
2012-02-27 21:33:53 +00:00
|
|
|
* Routines for packet dissection of ip.access GSM A-bis over IP
|
2009-07-10 20:00:54 +00:00
|
|
|
* Copyright 2009 by Harald Welte <laforge@gnumonks.org>
|
2010-06-20 14:37:34 +00:00
|
|
|
* Copyright 2009, 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
|
2009-07-10 20:00:54 +00:00
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2009-07-10 20:00:54 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2009-07-10 20:00:54 +00:00
|
|
|
|
|
|
|
#include <epan/packet.h>
|
2010-12-16 07:55:35 +00:00
|
|
|
#include <epan/prefs.h>
|
|
|
|
|
2013-12-15 23:44:12 +00:00
|
|
|
void proto_register_ipa(void);
|
|
|
|
void proto_reg_handoff_gsm_ipa(void);
|
|
|
|
|
2012-02-27 21:33:53 +00:00
|
|
|
/*
|
2012-02-27 21:34:59 +00:00
|
|
|
* Protocol used by ip.access's nanoBTS/nanoGSM GSM picocells:
|
|
|
|
*
|
|
|
|
* http://www.ipaccess.com/en/nanoGSM-picocell
|
|
|
|
*
|
|
|
|
* to transport the GSM A-bis interface over TCP and UDP.
|
2012-02-27 21:33:53 +00:00
|
|
|
*
|
|
|
|
* See
|
|
|
|
*
|
|
|
|
* http://openbsc.osmocom.org/trac/wiki/nanoBTS
|
|
|
|
*
|
|
|
|
* for some information about this protocol determined by reverse-
|
|
|
|
* engineering.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These ports are also registered for other protocols, as per
|
|
|
|
*
|
|
|
|
* http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml
|
2011-10-21 02:10:19 +00:00
|
|
|
*
|
2011-09-23 06:19:47 +00:00
|
|
|
* exlm-agent 3002
|
|
|
|
* cgms 3003
|
|
|
|
* ii-admin 3006
|
2011-10-21 02:10:19 +00:00
|
|
|
* vrml-multi-use 4200-4299
|
2011-09-23 06:19:47 +00:00
|
|
|
* commplex-main 5000
|
2012-02-27 21:33:53 +00:00
|
|
|
*
|
|
|
|
* But, as that document says:
|
|
|
|
*
|
|
|
|
************************************************************************
|
|
|
|
* PLEASE NOTE THE FOLLOWING: *
|
|
|
|
* *
|
|
|
|
* ASSIGNMENT OF A PORT NUMBER DOES NOT IN ANY WAY IMPLY AN *
|
|
|
|
* ENDORSEMENT OF AN APPLICATION OR PRODUCT, AND THE FACT THAT NETWORK *
|
|
|
|
* TRAFFIC IS FLOWING TO OR FROM A REGISTERED PORT DOES NOT MEAN THAT *
|
|
|
|
* IT IS "GOOD" TRAFFIC, NOR THAT IT NECESSARILY CORRESPONDS TO THE *
|
|
|
|
* ASSIGNED SERVICE. FIREWALL AND SYSTEM ADMINISTRATORS SHOULD *
|
|
|
|
* CHOOSE HOW TO CONFIGURE THEIR SYSTEMS BASED ON THEIR KNOWLEDGE OF *
|
|
|
|
* THE TRAFFIC IN QUESTION, NOT WHETHER THERE IS A PORT NUMBER *
|
|
|
|
* REGISTERED OR NOT. *
|
|
|
|
************************************************************************
|
2011-09-23 06:19:47 +00:00
|
|
|
*/
|
2017-12-19 22:22:23 +00:00
|
|
|
#define IPA_TCP_PORTS "3002,3003,3006,4222,4249,4250,5000"
|
2010-12-16 07:55:35 +00:00
|
|
|
|
2014-11-16 01:35:51 +00:00
|
|
|
static dissector_handle_t ipa_tcp_handle;
|
|
|
|
static dissector_handle_t ipa_udp_handle;
|
2010-12-16 08:03:57 +00:00
|
|
|
static gboolean global_ipa_in_root = FALSE;
|
|
|
|
static gboolean global_ipa_in_info = FALSE;
|
2009-07-10 20:00:54 +00:00
|
|
|
|
|
|
|
/* Initialize the protocol and registered fields */
|
2009-07-31 19:19:25 +00:00
|
|
|
static int proto_ipa = -1;
|
2009-07-10 20:00:54 +00:00
|
|
|
static int proto_ipaccess = -1;
|
|
|
|
|
2009-07-31 19:19:25 +00:00
|
|
|
static int hf_ipa_data_len = -1;
|
|
|
|
static int hf_ipa_protocol = -1;
|
2010-12-16 08:03:57 +00:00
|
|
|
static int hf_ipa_hsl_debug = -1;
|
2011-09-23 06:19:47 +00:00
|
|
|
static int hf_ipa_osmo_proto = -1;
|
|
|
|
static int hf_ipa_osmo_ctrl_data = -1;
|
2009-07-10 20:00:54 +00:00
|
|
|
|
|
|
|
static int hf_ipaccess_msgtype = -1;
|
|
|
|
static int hf_ipaccess_attr_tag = -1;
|
|
|
|
static int hf_ipaccess_attr_string = -1;
|
2014-08-07 12:36:30 +00:00
|
|
|
static int hf_ipaccess_attribute_unk = -1;
|
2009-07-10 20:00:54 +00:00
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
2009-07-31 19:19:25 +00:00
|
|
|
static gint ett_ipa = -1;
|
2009-07-10 20:00:54 +00:00
|
|
|
static gint ett_ipaccess = -1;
|
|
|
|
|
|
|
|
enum {
|
|
|
|
SUB_OML,
|
|
|
|
SUB_RSL,
|
2009-07-31 19:19:25 +00:00
|
|
|
SUB_SCCP,
|
2010-08-11 11:59:47 +00:00
|
|
|
SUB_MGCP,
|
2009-07-10 20:35:34 +00:00
|
|
|
/* SUB_IPACCESS, */
|
2011-09-23 06:19:47 +00:00
|
|
|
SUB_DATA,
|
2009-07-10 20:00:54 +00:00
|
|
|
|
|
|
|
SUB_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
static dissector_handle_t sub_handles[SUB_MAX];
|
2011-09-23 06:19:47 +00:00
|
|
|
static dissector_table_t osmo_dissector_table;
|
|
|
|
|
2009-07-10 20:00:54 +00:00
|
|
|
|
2009-11-19 07:06:59 +00:00
|
|
|
#define ABISIP_RSL_MAX 0x20
|
2010-12-16 08:03:57 +00:00
|
|
|
#define HSL_DEBUG 0xdd
|
2011-09-23 06:19:47 +00:00
|
|
|
#define OSMO_EXT 0xee
|
2010-08-11 11:59:47 +00:00
|
|
|
#define IPA_MGCP 0xfc
|
2009-07-31 19:19:25 +00:00
|
|
|
#define AIP_SCCP 0xfd
|
2009-07-10 20:00:54 +00:00
|
|
|
#define ABISIP_IPACCESS 0xfe
|
|
|
|
#define ABISIP_OML 0xff
|
2011-09-23 06:19:47 +00:00
|
|
|
#define IPAC_PROTO_EXT_CTRL 0x00
|
|
|
|
#define IPAC_PROTO_EXT_MGCP 0x01
|
2009-07-10 20:00:54 +00:00
|
|
|
|
2009-07-31 19:19:25 +00:00
|
|
|
static const value_string ipa_protocol_vals[] = {
|
2009-07-10 20:00:54 +00:00
|
|
|
{ 0x00, "RSL" },
|
2018-12-30 16:19:13 +00:00
|
|
|
{ HSL_DEBUG, "HSL Debug" },
|
|
|
|
{ OSMO_EXT, "OSMO EXT" },
|
|
|
|
{ IPA_MGCP, "MGCP (old)" },
|
|
|
|
{ AIP_SCCP, "SCCP" },
|
|
|
|
{ ABISIP_IPACCESS, "IPA" },
|
|
|
|
{ ABISIP_OML, "OML" },
|
2011-09-23 06:19:47 +00:00
|
|
|
{ 0, NULL }
|
2009-07-10 20:00:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string ipaccess_msgtype_vals[] = {
|
|
|
|
{ 0x00, "PING?" },
|
|
|
|
{ 0x01, "PONG!" },
|
|
|
|
{ 0x04, "IDENTITY REQUEST" },
|
|
|
|
{ 0x05, "IDENTITY RESPONSE" },
|
2009-07-11 08:38:41 +00:00
|
|
|
{ 0x06, "IDENTITY ACK" },
|
|
|
|
{ 0x07, "IDENTITY NACK" },
|
|
|
|
{ 0x08, "PROXY REQUEST" },
|
|
|
|
{ 0x09, "PROXY ACK" },
|
|
|
|
{ 0x0a, "PROXY NACK" },
|
2009-07-10 20:00:54 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string ipaccess_idtag_vals[] = {
|
|
|
|
{ 0x00, "Serial Number" },
|
|
|
|
{ 0x01, "Unit Name" },
|
|
|
|
{ 0x02, "Location" },
|
2009-07-11 08:38:41 +00:00
|
|
|
{ 0x03, "Unit Type" },
|
2009-07-10 20:00:54 +00:00
|
|
|
{ 0x04, "Equipment Version" },
|
|
|
|
{ 0x05, "Software Version" },
|
|
|
|
{ 0x06, "IP Address" },
|
|
|
|
{ 0x07, "MAC Address" },
|
|
|
|
{ 0x08, "Unit ID" },
|
2009-07-10 20:03:25 +00:00
|
|
|
{ 0, NULL }
|
2009-07-10 20:00:54 +00:00
|
|
|
};
|
|
|
|
|
2011-09-23 06:19:47 +00:00
|
|
|
static const value_string ipa_osmo_proto_vals[] = {
|
|
|
|
{ 0x00, "CTRL" },
|
|
|
|
{ 0x01, "MGCP" },
|
|
|
|
{ 0x02, "LAC" },
|
|
|
|
{ 0x03, "SMSC" },
|
2017-12-19 22:22:23 +00:00
|
|
|
{ 0x05, "GSUP" },
|
2011-09-23 06:19:47 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-07-10 20:00:54 +00:00
|
|
|
static gint
|
|
|
|
dissect_ipa_attr(tvbuff_t *tvb, int base_offs, proto_tree *tree)
|
|
|
|
{
|
|
|
|
guint8 len, attr_type;
|
|
|
|
|
|
|
|
int offset = base_offs;
|
|
|
|
|
2009-07-10 20:07:57 +00:00
|
|
|
while (tvb_reported_length_remaining(tvb, offset) > 0) {
|
2009-07-10 20:00:54 +00:00
|
|
|
attr_type = tvb_get_guint8(tvb, offset);
|
|
|
|
|
|
|
|
switch (attr_type) {
|
|
|
|
case 0x00: /* a string prefixed by its length */
|
|
|
|
len = tvb_get_guint8(tvb, offset+1);
|
|
|
|
proto_tree_add_item(tree, hf_ipaccess_attr_tag,
|
2011-09-23 06:19:47 +00:00
|
|
|
tvb, offset+2, 1, ENC_BIG_ENDIAN);
|
2009-07-10 20:00:54 +00:00
|
|
|
proto_tree_add_item(tree, hf_ipaccess_attr_string,
|
2011-10-15 18:46:26 +00:00
|
|
|
tvb, offset+3, len-1, ENC_ASCII|ENC_NA);
|
2009-07-10 20:00:54 +00:00
|
|
|
break;
|
2016-01-06 00:58:42 +00:00
|
|
|
case 0x01: /* a single-byte request for a certain attr */
|
2009-07-10 20:00:54 +00:00
|
|
|
len = 0;
|
|
|
|
proto_tree_add_item(tree, hf_ipaccess_attr_tag,
|
2011-09-23 06:19:47 +00:00
|
|
|
tvb, offset+1, 1, ENC_BIG_ENDIAN);
|
2009-07-10 20:00:54 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
len = 0;
|
2014-08-07 12:36:30 +00:00
|
|
|
proto_tree_add_uint(tree, hf_ipaccess_attribute_unk, tvb, offset+1, 1,
|
2009-07-10 20:00:54 +00:00
|
|
|
attr_type);
|
|
|
|
break;
|
|
|
|
};
|
|
|
|
offset += len + 2;
|
|
|
|
};
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Dissect an ip.access specific message */
|
|
|
|
static gint
|
|
|
|
dissect_ipaccess(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *ipaccess_tree;
|
|
|
|
guint8 msg_type;
|
|
|
|
|
|
|
|
msg_type = tvb_get_guint8(tvb, 0);
|
|
|
|
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
|
|
|
|
val_to_str(msg_type, ipaccess_msgtype_vals,
|
|
|
|
"unknown 0x%02x"));
|
2018-04-10 09:06:52 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_ipaccess, tvb, 0, -1, ENC_NA);
|
|
|
|
ipaccess_tree = proto_item_add_subtree(ti, ett_ipaccess);
|
|
|
|
proto_tree_add_item(ipaccess_tree, hf_ipaccess_msgtype,
|
|
|
|
tvb, 0, 1, ENC_BIG_ENDIAN);
|
|
|
|
switch (msg_type) {
|
2009-07-10 20:00:54 +00:00
|
|
|
case 4:
|
|
|
|
case 5:
|
|
|
|
dissect_ipa_attr(tvb, 1, ipaccess_tree);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2011-09-23 06:19:47 +00:00
|
|
|
/* Dissect the osmocom extension header */
|
|
|
|
static gint
|
2018-04-07 21:29:34 +00:00
|
|
|
dissect_osmo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ipatree, proto_tree *tree, proto_item *ipa_ti)
|
2011-09-23 06:19:47 +00:00
|
|
|
{
|
|
|
|
tvbuff_t *next_tvb;
|
|
|
|
guint8 osmo_proto;
|
2018-04-07 21:29:34 +00:00
|
|
|
const gchar *name;
|
2011-09-23 06:19:47 +00:00
|
|
|
|
|
|
|
osmo_proto = tvb_get_guint8(tvb, 0);
|
2018-04-07 21:29:34 +00:00
|
|
|
name = val_to_str(osmo_proto, ipa_osmo_proto_vals, "unknown 0x%02x");
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", name);
|
2011-09-23 06:19:47 +00:00
|
|
|
if (ipatree) {
|
2018-04-07 21:29:34 +00:00
|
|
|
proto_item_append_text(ipa_ti, " %s", name);
|
2011-09-23 06:19:47 +00:00
|
|
|
proto_tree_add_item(ipatree, hf_ipa_osmo_proto,
|
|
|
|
tvb, 0, 1, ENC_BIG_ENDIAN);
|
|
|
|
}
|
|
|
|
|
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, 1);
|
|
|
|
|
|
|
|
/* Call any subdissectors that registered for this protocol */
|
|
|
|
if (dissector_try_uint(osmo_dissector_table, osmo_proto, next_tvb, pinfo, tree))
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
/* Fallback to the standard MGCP dissector */
|
|
|
|
if (osmo_proto == IPAC_PROTO_EXT_MGCP) {
|
|
|
|
call_dissector(sub_handles[SUB_MGCP], next_tvb, pinfo, tree);
|
|
|
|
return 1;
|
|
|
|
/* Simply display the CTRL data as text */
|
|
|
|
} else if (osmo_proto == IPAC_PROTO_EXT_CTRL) {
|
2018-04-10 09:06:52 +00:00
|
|
|
proto_tree_add_item(tree, hf_ipa_osmo_ctrl_data, next_tvb, 0, -1, ENC_ASCII|ENC_NA);
|
2011-09-23 06:19:47 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
call_dissector(sub_handles[SUB_DATA], next_tvb, pinfo, tree);
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-07-10 20:00:54 +00:00
|
|
|
|
|
|
|
/* Code to actually dissect the packets */
|
2018-12-30 16:19:13 +00:00
|
|
|
static gboolean
|
2014-11-16 01:35:51 +00:00
|
|
|
dissect_ipa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean is_udp)
|
2009-07-10 20:00:54 +00:00
|
|
|
{
|
2010-06-20 14:37:34 +00:00
|
|
|
gint remaining;
|
|
|
|
gint header_length = 3;
|
2009-07-10 20:00:54 +00:00
|
|
|
int offset = 0;
|
2018-12-30 16:19:13 +00:00
|
|
|
guint16 len, msg_type;
|
|
|
|
|
|
|
|
if (tvb_reported_length(tvb) < 4)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
//sanity check the message type
|
|
|
|
msg_type = tvb_get_guint8(tvb, 2);
|
|
|
|
if ((try_val_to_str(msg_type, ipa_protocol_vals) == NULL) &&
|
|
|
|
(msg_type >= ABISIP_RSL_MAX))
|
|
|
|
return FALSE;
|
2009-07-10 20:00:54 +00:00
|
|
|
|
2009-07-31 19:19:25 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPA");
|
2009-07-10 20:00:54 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
|
|
|
|
2010-06-20 14:37:34 +00:00
|
|
|
while ((remaining = tvb_reported_length_remaining(tvb, offset)) > 0) {
|
2009-07-10 20:00:54 +00:00
|
|
|
proto_item *ti;
|
2010-12-16 08:03:57 +00:00
|
|
|
proto_tree *ipa_tree = NULL;
|
2009-07-10 20:00:54 +00:00
|
|
|
tvbuff_t *next_tvb;
|
|
|
|
|
2009-07-31 19:19:25 +00:00
|
|
|
len = tvb_get_ntohs(tvb, offset);
|
2009-07-10 20:00:54 +00:00
|
|
|
msg_type = tvb_get_guint8(tvb, offset+2);
|
|
|
|
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
|
2009-07-31 19:19:25 +00:00
|
|
|
val_to_str(msg_type, ipa_protocol_vals,
|
2009-07-10 20:00:54 +00:00
|
|
|
"unknown 0x%02x"));
|
|
|
|
|
2010-06-20 14:37:34 +00:00
|
|
|
/*
|
|
|
|
* The IPA header is different depending on the transport protocol.
|
|
|
|
* With UDP there seems to be a fourth byte for the IPA header.
|
|
|
|
* We attempt to detect this by checking if the length from the
|
|
|
|
* header + four bytes of the IPA header equals the remaining size.
|
|
|
|
*/
|
2014-11-16 01:35:51 +00:00
|
|
|
if (is_udp && (len + 4 == remaining)) {
|
2010-06-20 14:37:34 +00:00
|
|
|
header_length++;
|
|
|
|
}
|
|
|
|
|
2018-04-10 09:06:52 +00:00
|
|
|
ti = proto_tree_add_protocol_format(tree, proto_ipa,
|
|
|
|
tvb, offset, len+header_length,
|
|
|
|
"IPA protocol ip.access, type: %s",
|
|
|
|
val_to_str(msg_type, ipa_protocol_vals,
|
|
|
|
"unknown 0x%02x"));
|
|
|
|
ipa_tree = proto_item_add_subtree(ti, ett_ipa);
|
|
|
|
proto_tree_add_item(ipa_tree, hf_ipa_data_len,
|
|
|
|
tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(ipa_tree, hf_ipa_protocol,
|
|
|
|
tvb, offset+2, 1, ENC_BIG_ENDIAN);
|
2009-07-10 20:00:54 +00:00
|
|
|
|
2014-06-06 14:35:50 +00:00
|
|
|
next_tvb = tvb_new_subset_length(tvb, offset+header_length, len);
|
2009-07-10 20:00:54 +00:00
|
|
|
|
|
|
|
switch (msg_type) {
|
|
|
|
case ABISIP_OML:
|
|
|
|
/* hand this off to the standard A-bis OML dissector */
|
|
|
|
if (sub_handles[SUB_OML])
|
|
|
|
call_dissector(sub_handles[SUB_OML], next_tvb,
|
|
|
|
pinfo, tree);
|
|
|
|
break;
|
|
|
|
case ABISIP_IPACCESS:
|
|
|
|
dissect_ipaccess(next_tvb, pinfo, tree);
|
|
|
|
break;
|
2009-07-31 19:19:25 +00:00
|
|
|
case AIP_SCCP:
|
|
|
|
/* hand this off to the standard SCCP dissector */
|
|
|
|
call_dissector(sub_handles[SUB_SCCP], next_tvb, pinfo, tree);
|
|
|
|
break;
|
2010-08-11 11:59:47 +00:00
|
|
|
case IPA_MGCP:
|
|
|
|
/* hand this off to the standard MGCP dissector */
|
|
|
|
call_dissector(sub_handles[SUB_MGCP], next_tvb, pinfo, tree);
|
|
|
|
break;
|
2011-09-23 06:19:47 +00:00
|
|
|
case OSMO_EXT:
|
2018-04-07 21:29:34 +00:00
|
|
|
dissect_osmo(next_tvb, pinfo, ipa_tree, tree, ti);
|
2011-09-23 06:19:47 +00:00
|
|
|
break;
|
2010-12-16 08:03:57 +00:00
|
|
|
case HSL_DEBUG:
|
2018-04-10 09:06:52 +00:00
|
|
|
proto_tree_add_item(ipa_tree, hf_ipa_hsl_debug,
|
|
|
|
next_tvb, 0, len, ENC_ASCII|ENC_NA);
|
|
|
|
if (global_ipa_in_root == TRUE)
|
|
|
|
proto_tree_add_item(tree, hf_ipa_hsl_debug,
|
|
|
|
next_tvb, 0, len, ENC_ASCII|ENC_NA);
|
2010-12-16 08:03:57 +00:00
|
|
|
if (global_ipa_in_info == TRUE)
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
|
2014-06-17 15:30:58 +00:00
|
|
|
tvb_get_stringz_enc(wmem_packet_scope(), next_tvb, 0, NULL, ENC_ASCII));
|
2010-12-16 08:03:57 +00:00
|
|
|
break;
|
2009-11-19 07:06:59 +00:00
|
|
|
default:
|
|
|
|
if (msg_type < ABISIP_RSL_MAX) {
|
|
|
|
/* hand this off to the standard A-bis RSL dissector */
|
|
|
|
call_dissector(sub_handles[SUB_RSL], next_tvb, pinfo, tree);
|
|
|
|
}
|
|
|
|
break;
|
2009-07-10 20:00:54 +00:00
|
|
|
}
|
2010-06-20 14:37:34 +00:00
|
|
|
offset += len + header_length;
|
2009-07-10 20:00:54 +00:00
|
|
|
}
|
2018-12-30 16:19:13 +00:00
|
|
|
|
|
|
|
return TRUE;
|
2009-07-10 20:00:54 +00:00
|
|
|
}
|
|
|
|
|
2015-11-15 13:00:10 +00:00
|
|
|
static int
|
|
|
|
dissect_ipa_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
2014-11-16 01:35:51 +00:00
|
|
|
{
|
2018-12-30 16:19:13 +00:00
|
|
|
if (!dissect_ipa(tvb, pinfo, tree, FALSE))
|
|
|
|
return 0;
|
2015-11-15 13:00:10 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2014-11-16 01:35:51 +00:00
|
|
|
}
|
|
|
|
|
2015-11-15 13:00:10 +00:00
|
|
|
static int
|
|
|
|
dissect_ipa_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
2014-11-16 01:35:51 +00:00
|
|
|
{
|
2018-12-30 16:19:13 +00:00
|
|
|
if (!dissect_ipa(tvb, pinfo, tree, TRUE))
|
|
|
|
return 0;
|
|
|
|
|
2015-11-15 13:00:10 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2014-11-16 01:35:51 +00:00
|
|
|
}
|
|
|
|
|
2009-07-31 19:19:25 +00:00
|
|
|
void proto_register_ipa(void)
|
2009-07-10 20:00:54 +00:00
|
|
|
{
|
2010-12-16 07:55:35 +00:00
|
|
|
module_t *ipa_module;
|
|
|
|
|
2009-07-10 20:00:54 +00:00
|
|
|
static hf_register_info hf[] = {
|
2009-07-31 19:19:25 +00:00
|
|
|
{&hf_ipa_data_len,
|
2012-07-31 18:54:11 +00:00
|
|
|
{"DataLen", "gsm_ipa.data_len",
|
2010-06-20 14:37:34 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2009-07-10 20:00:54 +00:00
|
|
|
"The length of the data (in bytes)", HFILL}
|
|
|
|
},
|
2009-07-31 19:19:25 +00:00
|
|
|
{&hf_ipa_protocol,
|
2012-07-31 18:54:11 +00:00
|
|
|
{"Protocol", "gsm_ipa.protocol",
|
2009-07-31 19:19:25 +00:00
|
|
|
FT_UINT8, BASE_HEX, VALS(ipa_protocol_vals), 0x0,
|
|
|
|
"The IPA Sub-Protocol", HFILL}
|
2009-07-10 20:00:54 +00:00
|
|
|
},
|
2010-12-16 08:03:57 +00:00
|
|
|
{&hf_ipa_hsl_debug,
|
2012-07-31 18:54:11 +00:00
|
|
|
{"Debug Message", "gsm_ipa.hsl_debug",
|
2010-12-16 08:03:57 +00:00
|
|
|
FT_STRING, BASE_NONE, NULL, 0,
|
|
|
|
"Hay Systems Limited debug message", HFILL}
|
|
|
|
},
|
2011-09-23 06:19:47 +00:00
|
|
|
{&hf_ipa_osmo_proto,
|
2012-07-31 18:54:11 +00:00
|
|
|
{"Osmo ext protocol", "gsm_ipa.osmo.protocol",
|
2011-09-23 06:19:47 +00:00
|
|
|
FT_UINT8, BASE_HEX, VALS(ipa_osmo_proto_vals), 0x0,
|
|
|
|
"The osmo extension protocol", HFILL}
|
|
|
|
},
|
|
|
|
|
|
|
|
{&hf_ipa_osmo_ctrl_data,
|
2012-07-31 18:54:11 +00:00
|
|
|
{"CTRL data", "gsm_ipa.ctrl.data",
|
2011-09-23 06:19:47 +00:00
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Control interface data", HFILL}
|
|
|
|
},
|
|
|
|
|
2009-07-10 20:00:54 +00:00
|
|
|
};
|
|
|
|
static hf_register_info hf_ipa[] = {
|
|
|
|
{&hf_ipaccess_msgtype,
|
|
|
|
{"MessageType", "ipaccess.msg_type",
|
|
|
|
FT_UINT8, BASE_HEX, VALS(ipaccess_msgtype_vals), 0x0,
|
2015-11-18 15:55:07 +00:00
|
|
|
"Type of ip.access message", HFILL}
|
2009-07-10 20:00:54 +00:00
|
|
|
},
|
|
|
|
{&hf_ipaccess_attr_tag,
|
|
|
|
{"Tag", "ipaccess.attr_tag",
|
|
|
|
FT_UINT8, BASE_HEX, VALS(ipaccess_idtag_vals), 0x0,
|
|
|
|
"Attribute Tag", HFILL}
|
|
|
|
},
|
|
|
|
{&hf_ipaccess_attr_string,
|
|
|
|
{"String", "ipaccess.attr_string",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"String attribute", HFILL}
|
|
|
|
},
|
2014-08-07 12:36:30 +00:00
|
|
|
{&hf_ipaccess_attribute_unk,
|
|
|
|
{"Unknown attribute type", "ipaccess.attr_unk",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}
|
|
|
|
},
|
2009-07-10 20:00:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett[] = {
|
2009-07-31 19:19:25 +00:00
|
|
|
&ett_ipa,
|
2009-07-10 20:00:54 +00:00
|
|
|
&ett_ipaccess,
|
|
|
|
};
|
|
|
|
|
2014-11-16 01:35:51 +00:00
|
|
|
proto_ipa = proto_register_protocol("GSM over IP protocol as used by ip.access", "GSM over IP", "gsm_ipa");
|
|
|
|
proto_ipaccess = proto_register_protocol("GSM over IP ip.access CCM sub-protocol", "IPA", "ipaccess");
|
2009-07-10 20:00:54 +00:00
|
|
|
|
2009-07-31 19:19:25 +00:00
|
|
|
proto_register_field_array(proto_ipa, hf, array_length(hf));
|
2009-07-10 20:00:54 +00:00
|
|
|
proto_register_field_array(proto_ipaccess, hf_ipa, array_length(hf_ipa));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
|
2011-09-23 06:19:47 +00:00
|
|
|
/* Register table for subdissectors */
|
|
|
|
osmo_dissector_table = register_dissector_table("ipa.osmo.protocol",
|
2016-03-13 11:51:45 +00:00
|
|
|
"GSM over IP ip.access Protocol", proto_ipa,
|
2016-08-30 22:51:54 +00:00
|
|
|
FT_UINT8, BASE_DEC);
|
2011-09-23 06:19:47 +00:00
|
|
|
|
2016-10-05 20:33:54 +00:00
|
|
|
ipa_module = prefs_register_protocol(proto_ipa, NULL);
|
2010-12-16 08:03:57 +00:00
|
|
|
|
|
|
|
prefs_register_bool_preference(ipa_module, "hsl_debug_in_root_tree",
|
|
|
|
"HSL Debug messages in root protocol tree",
|
|
|
|
NULL, &global_ipa_in_root);
|
|
|
|
prefs_register_bool_preference(ipa_module, "hsl_debug_in_info",
|
|
|
|
"HSL Debug messages in INFO column",
|
|
|
|
NULL, &global_ipa_in_info);
|
2010-12-16 07:55:35 +00:00
|
|
|
}
|
|
|
|
|
2009-07-31 19:19:25 +00:00
|
|
|
void proto_reg_handoff_gsm_ipa(void)
|
2009-07-10 20:00:54 +00:00
|
|
|
{
|
2016-10-05 20:33:54 +00:00
|
|
|
sub_handles[SUB_RSL] = find_dissector_add_dependency("gsm_abis_rsl", proto_ipa);
|
|
|
|
sub_handles[SUB_OML] = find_dissector_add_dependency("gsm_abis_oml", proto_ipa);
|
|
|
|
sub_handles[SUB_SCCP] = find_dissector_add_dependency("sccp", proto_ipa);
|
|
|
|
sub_handles[SUB_MGCP] = find_dissector_add_dependency("mgcp", proto_ipa);
|
|
|
|
sub_handles[SUB_DATA] = find_dissector("data");
|
|
|
|
|
|
|
|
ipa_tcp_handle = create_dissector_handle(dissect_ipa_tcp, proto_ipa);
|
|
|
|
ipa_udp_handle = create_dissector_handle(dissect_ipa_udp, proto_ipa);
|
|
|
|
dissector_add_uint_range_with_preference("tcp.port", IPA_TCP_PORTS, ipa_tcp_handle);
|
|
|
|
dissector_add_uint_range_with_preference("udp.port", "", ipa_udp_handle);
|
2009-07-10 20:00:54 +00:00
|
|
|
}
|
2014-10-04 15:28:35 +00:00
|
|
|
|
|
|
|
/*
|
2019-07-26 18:43:17 +00:00
|
|
|
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
2014-10-04 15:28:35 +00:00
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 8
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: t
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
|
|
* :indentSize=8:tabSize=8:noTabs=false:
|
|
|
|
*/
|