aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_abis_om2000.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-10-15 20:04:41 +0200
committerMichael Mann <mmann78@netscape.net>2016-10-27 13:22:34 +0000
commit64279d3455af2a676e0431d4bee6132219b4c513 (patch)
treeaa69c5ace69ba1ee886e19dbdbb1a3c403cb5170 /epan/dissectors/packet-gsm_abis_om2000.c
parent94b4617acaf2a8c8108aa16841d2a321b93623d9 (diff)
gsm_abis_om2000: Introduce expert info for unusual situations
In OM2000, it is not usual to receive NACK, REJECT or "performed not according to request" type messages. Let's highlight them using expert info as a convenience to the user. Change-Id: I47b865c32fd9ec82ec63699babd31f3849f3006c Reviewed-on: https://code.wireshark.org/review/18453 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-gsm_abis_om2000.c')
-rw-r--r--epan/dissectors/packet-gsm_abis_om2000.c46
1 files changed, 39 insertions, 7 deletions
diff --git a/epan/dissectors/packet-gsm_abis_om2000.c b/epan/dissectors/packet-gsm_abis_om2000.c
index 457977568e..9fb57ec0b3 100644
--- a/epan/dissectors/packet-gsm_abis_om2000.c
+++ b/epan/dissectors/packet-gsm_abis_om2000.c
@@ -29,6 +29,7 @@
#include "config.h"
#include <epan/packet.h>
+#include <epan/expert.h>
void proto_register_abis_om2000(void);
@@ -122,6 +123,10 @@ static int ett_om2k_isl = -1;
static int ett_om2k_conl = -1;
static int ett_om2k_iwd = -1;
+static expert_field ei_om2k_not_performed = EI_INIT;
+static expert_field ei_om2k_reject = EI_INIT;
+static expert_field ei_om2k_nack = EI_INIT;
+
static const value_string om2k_msgcode_vals[] = {
{ 0x0000, "Abort SP Command" },
{ 0x0002, "Abort SP Complete" },
@@ -790,16 +795,20 @@ dissect_om2k_negotiation_record2(tvbuff_t *tvb, gint base_offset, proto_tree *tr
static gint
-dissect_om2k_attrs(tvbuff_t *tvb, gint offset, proto_tree *tree)
+dissect_om2k_attrs(tvbuff_t *tvb, packet_info *pinfo, gint offset, proto_tree *tree)
{
while (tvb_reported_length_remaining(tvb, offset) > 0) {
guint8 iei = tvb_get_guint8(tvb, offset++);
guint8 len, tmp;
+ proto_item *ti;
switch (iei) {
case 0x00: /* Accordance Information */
- proto_tree_add_item(tree, hf_om2k_aip, tvb,
- offset++, 1, ENC_BIG_ENDIAN);
+ tmp = tvb_get_guint8(tvb, offset);
+ ti = proto_tree_add_item(tree, hf_om2k_aip, tvb,
+ offset++, 1, ENC_BIG_ENDIAN);
+ if (tmp != 0x00)
+ expert_add_info(pinfo, ti, &ei_om2k_not_performed);
break;
case 0x06: /* BCC */
proto_tree_add_item(tree, hf_om2k_bcc, tvb,
@@ -1150,6 +1159,7 @@ dissect_abis_om2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
proto_tree *om2k_tree;
guint16 msg_code;
guint8 tmp;
+ const gchar *msgt_str;
int offset;
@@ -1176,9 +1186,8 @@ dissect_abis_om2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
if (tree == NULL)
return tvb_captured_length(tvb); /* No refs to COL_... beyond this point */
- proto_item_append_text(ti, " %s ",
- val_to_str_ext(msg_code, &om2k_msgcode_vals_ext,
- "unknown 0x%04x"));
+ msgt_str = val_to_str_ext(msg_code, &om2k_msgcode_vals_ext, "unknown 0x%04x");
+ proto_item_append_text(ti, " %s ", msgt_str);
switch (msg_code) {
case 0x74: /* Operational Info */
@@ -1203,7 +1212,13 @@ dissect_abis_om2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
default:
break;
}
- dissect_om2k_attrs(tvb, offset, om2k_tree);
+
+ if (strstr(msgt_str, "Reject"))
+ expert_add_info(pinfo, ti, &ei_om2k_reject);
+ if (strstr(msgt_str, "NACK"))
+ expert_add_info(pinfo, ti, &ei_om2k_nack);
+
+ dissect_om2k_attrs(tvb, pinfo, offset, om2k_tree);
return tvb_captured_length(tvb);
}
@@ -1611,11 +1626,28 @@ proto_register_abis_om2000(void)
&ett_om2k_conl,
&ett_om2k_iwd,
};
+ static ei_register_info ei[] = {
+ { &ei_om2k_not_performed,
+ { "gsm_abis_om2000.not_performed", PI_RESPONSE_CODE, PI_WARN,
+ "Operation not performed as per request", EXPFILL }
+ },
+ { &ei_om2k_reject,
+ { "gsm_abis_om2000.reject", PI_RESPONSE_CODE, PI_WARN,
+ "Operation Rejected by RBS", EXPFILL }
+ },
+ { &ei_om2k_nack,
+ { "gsm_abis_om2000.nack", PI_RESPONSE_CODE, PI_ERROR,
+ "Operation NACKed by peer", EXPFILL }
+ },
+ };
+ expert_module_t *expert_om2000;
proto_abis_om2000 = proto_register_protocol("Ericsson A-bis OML",
"Ericsson OML",
"gsm_abis_om2000");
+ expert_om2000 = expert_register_protocol(proto_abis_om2000);
+ expert_register_field_array(expert_om2000, ei, array_length(ei));
proto_register_field_array(proto_abis_om2000, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));