Harald Welte | e416192 | 2010-11-29 15:56:49 +0100 | [diff] [blame] | 1 | Index: wireshark/epan/dissectors/packet-gsm_ipa.c |
| 2 | =================================================================== |
| 3 | --- wireshark.orig/epan/dissectors/packet-gsm_ipa.c |
| 4 | +++ wireshark/epan/dissectors/packet-gsm_ipa.c |
Harald Welte | c1a3336 | 2010-12-01 00:02:58 +0100 | [diff] [blame^] | 5 | @@ -40,6 +40,8 @@ |
| 6 | static dissector_handle_t ipa_handle; |
| 7 | static range_t *global_ipa_tcp_ports = NULL; |
| 8 | static range_t *global_ipa_udp_ports = NULL; |
| 9 | +static gboolean global_ipa_in_root; |
| 10 | +static gboolean global_ipa_in_info; |
| 11 | |
| 12 | /* Initialize the protocol and registered fields */ |
| 13 | static int proto_ipa = -1; |
| 14 | @@ -47,6 +49,7 @@ |
Harald Welte | e416192 | 2010-11-29 15:56:49 +0100 | [diff] [blame] | 15 | |
| 16 | static int hf_ipa_data_len = -1; |
| 17 | static int hf_ipa_protocol = -1; |
| 18 | +static int hf_ipa_hsl_debug = -1; |
| 19 | |
| 20 | static int hf_ipaccess_msgtype = -1; |
| 21 | static int hf_ipaccess_attr_tag = -1; |
Harald Welte | c1a3336 | 2010-12-01 00:02:58 +0100 | [diff] [blame^] | 22 | @@ -73,6 +76,7 @@ |
Harald Welte | e416192 | 2010-11-29 15:56:49 +0100 | [diff] [blame] | 23 | #define AIP_SCCP 0xfd |
| 24 | #define ABISIP_IPACCESS 0xfe |
| 25 | #define ABISIP_OML 0xff |
| 26 | +#define HSL_DEBUG 0xdd |
| 27 | |
| 28 | static const value_string ipa_protocol_vals[] = { |
| 29 | { 0x00, "RSL" }, |
Harald Welte | c1a3336 | 2010-12-01 00:02:58 +0100 | [diff] [blame^] | 30 | @@ -80,6 +84,7 @@ |
Harald Welte | e416192 | 2010-11-29 15:56:49 +0100 | [diff] [blame] | 31 | { 0xfd, "SCCP" }, |
| 32 | { 0xfe, "IPA" }, |
| 33 | { 0xff, "OML" }, |
| 34 | + { 0xdd, "HSL Debug" }, |
| 35 | { 0, NULL } |
| 36 | }; |
| 37 | |
Harald Welte | c1a3336 | 2010-12-01 00:02:58 +0100 | [diff] [blame^] | 38 | @@ -187,7 +192,7 @@ |
Harald Welte | e416192 | 2010-11-29 15:56:49 +0100 | [diff] [blame] | 39 | |
| 40 | while ((remaining = tvb_reported_length_remaining(tvb, offset)) > 0) { |
| 41 | proto_item *ti; |
| 42 | - proto_tree *ipa_tree; |
| 43 | + proto_tree *ipa_tree = NULL; |
| 44 | guint16 len, msg_type; |
| 45 | tvbuff_t *next_tvb; |
| 46 | |
Harald Welte | c1a3336 | 2010-12-01 00:02:58 +0100 | [diff] [blame^] | 47 | @@ -241,6 +246,18 @@ |
Harald Welte | e416192 | 2010-11-29 15:56:49 +0100 | [diff] [blame] | 48 | /* hand this off to the standard MGCP dissector */ |
| 49 | call_dissector(sub_handles[SUB_MGCP], next_tvb, pinfo, tree); |
| 50 | break; |
| 51 | + case HSL_DEBUG: |
| 52 | + if (tree) { |
Harald Welte | c1a3336 | 2010-12-01 00:02:58 +0100 | [diff] [blame^] | 53 | + proto_tree_add_item(ipa_tree, hf_ipa_hsl_debug, |
| 54 | + next_tvb, 0, len, FALSE); |
| 55 | + if (global_ipa_in_root == TRUE) |
| 56 | + proto_tree_add_item(tree, hf_ipa_hsl_debug, |
| 57 | + next_tvb, 0, len, FALSE); |
Harald Welte | e416192 | 2010-11-29 15:56:49 +0100 | [diff] [blame] | 58 | + } |
Harald Welte | c1a3336 | 2010-12-01 00:02:58 +0100 | [diff] [blame^] | 59 | + if (global_ipa_in_info == TRUE) |
| 60 | + col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", |
| 61 | + tvb_get_stringz(next_tvb, 0, NULL)); |
Harald Welte | e416192 | 2010-11-29 15:56:49 +0100 | [diff] [blame] | 62 | + break; |
| 63 | default: |
| 64 | if (msg_type < ABISIP_RSL_MAX) { |
| 65 | /* hand this off to the standard A-bis RSL dissector */ |
Harald Welte | c1a3336 | 2010-12-01 00:02:58 +0100 | [diff] [blame^] | 66 | @@ -269,6 +286,11 @@ |
Harald Welte | e416192 | 2010-11-29 15:56:49 +0100 | [diff] [blame] | 67 | FT_UINT8, BASE_HEX, VALS(ipa_protocol_vals), 0x0, |
| 68 | "The IPA Sub-Protocol", HFILL} |
| 69 | }, |
| 70 | + {&hf_ipa_hsl_debug, |
| 71 | + {"Debug Message", "ipa.hsl_debug", |
| 72 | + FT_STRING, BASE_NONE, NULL, 0, |
| 73 | + NULL, HFILL} |
| 74 | + }, |
| 75 | }; |
| 76 | static hf_register_info hf_ipa[] = { |
| 77 | {&hf_ipaccess_msgtype, |
Harald Welte | c1a3336 | 2010-12-01 00:02:58 +0100 | [diff] [blame^] | 78 | @@ -321,6 +343,13 @@ |
| 79 | "Set the port(s) for ip.access IPA" |
| 80 | " (default: " IPA_UDP_PORTS ")", |
| 81 | &global_ipa_udp_ports, MAX_UDP_PORT); |
| 82 | + |
| 83 | + prefs_register_bool_preference(ipa_module, "hsl_debug_in_root_tree", |
| 84 | + "HSL Debug messages in root protocol tree", |
| 85 | + NULL, &global_ipa_in_root); |
| 86 | + prefs_register_bool_preference(ipa_module, "hsl_debug_in_info", |
| 87 | + "HSL Debug messages in INFO column", |
| 88 | + NULL, &global_ipa_in_info); |
| 89 | } |
| 90 | |
| 91 | static void ipa_tcp_delete_callback(guint32 port) |