fix parsing of ip.access GPRS OML attributes and RSL IP + Port

This commit is contained in:
Harald Welte 2009-07-11 16:41:15 +02:00
parent eb438442d0
commit 2c544c8d55
1 changed files with 87 additions and 70 deletions

View File

@ -1,7 +1,7 @@
Index: wireshark/epan/dissectors/Makefile.common Index: wireshark/epan/dissectors/Makefile.common
=================================================================== ===================================================================
--- wireshark.orig/epan/dissectors/Makefile.common 2009-07-03 22:20:16.000000000 +0200 --- wireshark.orig/epan/dissectors/Makefile.common 2009-07-10 23:17:56.000000000 +0200
+++ wireshark/epan/dissectors/Makefile.common 2009-07-04 03:46:47.000000000 +0200 +++ wireshark/epan/dissectors/Makefile.common 2009-07-11 10:11:29.000000000 +0200
@@ -926,6 +926,7 @@ @@ -926,6 +926,7 @@
# Dissectors with warnings. # Dissectors with warnings.
# #
@ -13,8 +13,8 @@ Index: wireshark/epan/dissectors/Makefile.common
Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ wireshark/epan/dissectors/packet-gsm_abis_oml.c 2009-07-04 03:47:46.000000000 +0200 +++ wireshark/epan/dissectors/packet-gsm_abis_oml.c 2009-07-11 16:40:31.000000000 +0200
@@ -0,0 +1,1241 @@ @@ -0,0 +1,1244 @@
+/* packet-abis_oml.c +/* packet-abis_oml.c
+ * Routines for packet dissection of GSM A-bis over IP (3GPP TS 12.21) + * Routines for packet dissection of GSM A-bis over IP (3GPP TS 12.21)
+ * Copyright 2009 by Harald Welte <laforge@gnumonks.org> + * Copyright 2009 by Harald Welte <laforge@gnumonks.org>
@ -72,6 +72,7 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+static int hf_oml_fom_attr_val = -1; +static int hf_oml_fom_attr_val = -1;
+/* FOM attributes */ +/* FOM attributes */
+static int hf_attr_adm_state = -1; +static int hf_attr_adm_state = -1;
+static int hf_attr_arfcn = -1;
+static int hf_attr_oper_state = -1; +static int hf_attr_oper_state = -1;
+static int hf_attr_avail_state = -1; +static int hf_attr_avail_state = -1;
+static int hf_attr_event_type = -1; +static int hf_attr_event_type = -1;
@ -675,7 +676,10 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+ int offset = base_offs; + int offset = base_offs;
+ +
+ while (tvb_reported_length_remaining(tvb, offset) != 0) { + while (tvb_reported_length_remaining(tvb, offset) != 0) {
+ guint i;
+ guint8 tag, val8; + guint8 tag, val8;
+ guint16 val16;
+ guint32 val32;
+ unsigned int len, len_len, hlen; + unsigned int len, len_len, hlen;
+ const struct tlv_def *tdef; + const struct tlv_def *tdef;
+ proto_item *ti; + proto_item *ti;
@ -736,31 +740,30 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+ case NM_ATT_ADM_STATE: + case NM_ATT_ADM_STATE:
+ proto_tree_add_item(att_tree, hf_attr_adm_state, tvb, + proto_tree_add_item(att_tree, hf_attr_adm_state, tvb,
+ offset, len, FALSE); + offset, len, FALSE);
+ if (check_col(pinfo->cinfo, COL_INFO)) { + val8 = tvb_get_guint8(tvb, offset);
+ val8 = tvb_get_guint8(tvb, offset); + col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", + val_to_str(val8, oml_adm_state_vals,
+ val_to_str(val8, + "%02x"));
+ oml_adm_state_vals,
+ "%02x"));
+ }
+ break; + break;
+ case NM_ATT_ARFCN_LIST: + case NM_ATT_ARFCN_LIST:
+ for (i = 0; i < len; i += 2) {
+ val16 = tvb_get_ntohs(tvb, offset + i);
+ proto_tree_add_uint(att_tree, hf_attr_arfcn,
+ tvb, offset + i, 2, val16);
+ }
+ break; + break;
+ case NM_ATT_AVAIL_STATUS: + case NM_ATT_AVAIL_STATUS:
+ proto_tree_add_item(att_tree, hf_attr_avail_state, tvb, + /* Availability status can have length 0 */
+ offset, len, FALSE); + if (len) {
+ if (check_col(pinfo->cinfo, COL_INFO)) { + val8 = tvb_get_guint8(tvb, offset);
+ /* Availability status can have length 0 */ + proto_tree_add_item(att_tree,
+ if (len) + hf_attr_avail_state, tvb,
+ val8 = tvb_get_guint8(tvb, offset); + offset, len, FALSE);
+ else + } else
+ val8 = 0xff; + val8 = 0xff;
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", + col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
+ val_to_str(val8, + val_to_str(val8, oml_avail_state_vals,
+ oml_avail_state_vals, + "%02x"));
+ "%02x"));
+ }
+
+ break; + break;
+ case NM_ATT_BCCH_ARFCN: + case NM_ATT_BCCH_ARFCN:
+ proto_tree_add_item(att_tree, hf_attr_bcch_arfcn, tvb, + proto_tree_add_item(att_tree, hf_attr_bcch_arfcn, tvb,
@ -785,13 +788,10 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+ case NM_ATT_OPER_STATE: + case NM_ATT_OPER_STATE:
+ proto_tree_add_item(att_tree, hf_attr_oper_state, tvb, + proto_tree_add_item(att_tree, hf_attr_oper_state, tvb,
+ offset, len, FALSE); + offset, len, FALSE);
+ if (check_col(pinfo->cinfo, COL_INFO)) { + val8 = tvb_get_guint8(tvb, offset);
+ val8 = tvb_get_guint8(tvb, offset); + col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", + val_to_str(val8, oml_oper_state_vals,
+ val_to_str(val8, + "%02x"));
+ oml_oper_state_vals,
+ "%02x"));
+ }
+ break; + break;
+ case NM_ATT_TEI: + case NM_ATT_TEI:
+ proto_tree_add_item(att_tree, hf_attr_tei, tvb, + proto_tree_add_item(att_tree, hf_attr_tei, tvb,
@ -811,23 +811,22 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+ case NM_ATT_TEST_NO: + case NM_ATT_TEST_NO:
+ proto_tree_add_item(att_tree, hf_attr_test_no, tvb, + proto_tree_add_item(att_tree, hf_attr_test_no, tvb,
+ offset, len, TRUE); + offset, len, TRUE);
+ if (check_col(pinfo->cinfo, COL_INFO)) { + val8 = tvb_get_guint8(tvb, offset);
+ val8 = tvb_get_guint8(tvb, offset); + col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", + val_to_str(val8, oml_test_no_vals,
+ val_to_str(val8, + "%02x"));
+ oml_test_no_vals,
+ "%02x"));
+ }
+ break; + break;
+ +
+ /* proprietary ip.access extensions */ + /* proprietary ip.access extensions */
+ case NM_ATT_IPACC_RSL_BSC_IP: + case NM_ATT_IPACC_RSL_BSC_IP:
+ proto_tree_add_item(att_tree, hf_attr_ipa_rsl_ip, tvb, + val32 = tvb_get_ntohl(tvb, offset);
+ offset, len, TRUE); + proto_tree_add_ipv4(att_tree, hf_attr_ipa_rsl_ip, tvb,
+ offset, len, val32);
+ break; + break;
+ case NM_ATT_IPACC_RSL_BSC_PORT: + case NM_ATT_IPACC_RSL_BSC_PORT:
+ proto_tree_add_item(att_tree, hf_attr_ipa_rsl_port, tvb, + val16 = tvb_get_ntohs(tvb, offset);
+ offset, len, TRUE); + proto_tree_add_uint(att_tree, hf_attr_ipa_rsl_port, tvb,
+ offset, len, val16);
+ break; + break;
+ case NM_ATT_IPACC_LOCATION: + case NM_ATT_IPACC_LOCATION:
+ proto_tree_add_item(att_tree, hf_attr_ipa_location_name, + proto_tree_add_item(att_tree, hf_attr_ipa_location_name,
@ -847,9 +846,6 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+ proto_tree_add_item(att_tree, hf_attr_ipa_prim_oml_port, + proto_tree_add_item(att_tree, hf_attr_ipa_prim_oml_port,
+ tvb, offset+1+4, 2, TRUE); + tvb, offset+1+4, 2, TRUE);
+ break; + break;
+ case NM_ATT_IPACC_SEC_OML_IP:
+ /* FIXME */
+ break;
+ case NM_ATT_IPACC_NV_FLAGS: + case NM_ATT_IPACC_NV_FLAGS:
+ { + {
+ guint flags, mask; + guint flags, mask;
@ -863,6 +859,8 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+ tvb, offset+1, 3, mask); + tvb, offset+1, 3, mask);
+ } + }
+ break; + break;
+ case NM_ATT_IPACC_SEC_OML_IP:
+ /* FIXME */
+ default: + default:
+ proto_tree_add_item(att_tree, hf_oml_fom_attr_val, tvb, + proto_tree_add_item(att_tree, hf_oml_fom_attr_val, tvb,
+ offset, len, FALSE); + offset, len, FALSE);
@ -873,7 +871,8 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+} +}
+ +
+static int +static int
+dissect_oml_fom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) +dissect_oml_fom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
+ int offset, proto_item *top_ti)
+{ +{
+ guint8 msg_type, obj_class, bts_nr, trx_nr, ts_nr; + guint8 msg_type, obj_class, bts_nr, trx_nr, ts_nr;
+ proto_item *ti; + proto_item *ti;
@ -884,13 +883,16 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+ bts_nr = tvb_get_guint8(tvb, offset+2); + bts_nr = tvb_get_guint8(tvb, offset+2);
+ trx_nr = tvb_get_guint8(tvb, offset+3); + trx_nr = tvb_get_guint8(tvb, offset+3);
+ ts_nr = tvb_get_guint8(tvb, offset+4); + ts_nr = tvb_get_guint8(tvb, offset+4);
+ if (check_col(pinfo->cinfo, COL_INFO)) { + proto_item_append_text(top_ti, ", %s(%02x,%02x,%02x) %s ",
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%02x,%02x,%02x) %s ", + val_to_str(obj_class, oml_fom_objclass_vals, "%02x"),
+ val_to_str(obj_class, oml_fom_objclass_vals, "%02x"), + bts_nr, trx_nr, ts_nr,
+ bts_nr, trx_nr, ts_nr, + val_to_str(msg_type, oml_fom_msgtype_vals,
+ val_to_str(msg_type, oml_fom_msgtype_vals, + "unknown 0x%x"));
+ "unknown 0x%x")); + col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%02x,%02x,%02x) %s ",
+ } + val_to_str(obj_class, oml_fom_objclass_vals, "%02x"),
+ bts_nr, trx_nr, ts_nr,
+ val_to_str(msg_type, oml_fom_msgtype_vals,
+ "unknown 0x%x"));
+ ti = proto_tree_add_item(tree, hf_oml_fom_msgtype, tvb, offset++, 1, FALSE); + ti = proto_tree_add_item(tree, hf_oml_fom_msgtype, tvb, offset++, 1, FALSE);
+ fom_tree = proto_item_add_subtree(ti, ett_oml_fom); + fom_tree = proto_item_add_subtree(ti, ett_oml_fom);
+ proto_tree_add_item(fom_tree, hf_oml_fom_objclass, tvb, offset++, 1, FALSE); + proto_tree_add_item(fom_tree, hf_oml_fom_objclass, tvb, offset++, 1, FALSE);
@ -908,7 +910,8 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+static const guint8 ipaccess_magic[] = "com.ipaccess"; +static const guint8 ipaccess_magic[] = "com.ipaccess";
+ +
+static int +static int
+dissect_oml_manuf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) +dissect_oml_manuf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
+ int offset, proto_item *top_ti)
+{ +{
+ if (tvb_get_guint8(tvb, offset) != 0x0d || + if (tvb_get_guint8(tvb, offset) != 0x0d ||
+ tvb_memeql(tvb, offset+1, ipaccess_magic, sizeof(ipaccess_magic))) + tvb_memeql(tvb, offset+1, ipaccess_magic, sizeof(ipaccess_magic)))
@ -916,7 +919,7 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+ +
+ offset += sizeof(ipaccess_magic) + 1; + offset += sizeof(ipaccess_magic) + 1;
+ +
+ return dissect_oml_fom(tvb, pinfo, tree, offset); + return dissect_oml_fom(tvb, pinfo, tree, offset, top_ti);
+} +}
+ +
+static void +static void
@ -927,12 +930,7 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+ +
+ int offset = 0; + int offset = 0;
+ +
+ if (check_col(pinfo->cinfo, COL_PROTOCOL)) + col_set_str(pinfo->cinfo, COL_PROTOCOL, "OML");
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "OML");
+#if 0
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_clear(pinfo->cinfo, COL_INFO);
+#endif
+ +
+ top_tree = tree; + top_tree = tree;
+ if (tree) { + if (tree) {
@ -952,10 +950,11 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+ +
+ switch (msg_disc) { + switch (msg_disc) {
+ case ABIS_OM_MDISC_FOM: + case ABIS_OM_MDISC_FOM:
+ offset = dissect_oml_fom(tvb, pinfo, oml_tree, offset); + offset = dissect_oml_fom(tvb, pinfo, oml_tree,
+ offset, ti);
+ break; + break;
+ case ABIS_OM_MDISC_MANUF: + case ABIS_OM_MDISC_MANUF:
+ offset = dissect_oml_manuf(tvb, pinfo, oml_tree, offset); + offset = dissect_oml_manuf(tvb, pinfo, oml_tree, offset, ti);
+ break; + break;
+ case ABIS_OM_MDISC_MMI: + case ABIS_OM_MDISC_MMI:
+ case ABIS_OM_MDISC_TRAU: + case ABIS_OM_MDISC_TRAU:
@ -1038,6 +1037,10 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
+ FT_UINT8, BASE_HEX, VALS(oml_adm_state_vals), 0, + FT_UINT8, BASE_HEX, VALS(oml_adm_state_vals), 0,
+ NULL, HFILL } + NULL, HFILL }
+ }, + },
+ { &hf_attr_arfcn,
+ { "ARFCN", "oml.fom.attr.arfcn",
+ FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
+ },
+ { &hf_attr_oper_state, + { &hf_attr_oper_state,
+ { "Operational State", "oml.fom.attr.oper_state", + { "Operational State", "oml.fom.attr.oper_state",
+ FT_UINT8, BASE_HEX, VALS(oml_oper_state_vals), 0, + FT_UINT8, BASE_HEX, VALS(oml_oper_state_vals), 0,
@ -1259,8 +1262,8 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.c
Index: wireshark/epan/dissectors/packet-gsm_abis_oml.h Index: wireshark/epan/dissectors/packet-gsm_abis_oml.h
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ wireshark/epan/dissectors/packet-gsm_abis_oml.h 2009-07-04 03:46:47.000000000 +0200 +++ wireshark/epan/dissectors/packet-gsm_abis_oml.h 2009-07-11 10:54:34.000000000 +0200
@@ -0,0 +1,726 @@ @@ -0,0 +1,740 @@
+/* GSM Network Management messages on the A-bis interface +/* GSM Network Management messages on the A-bis interface
+ * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 */ + * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 */
+ +
@ -1897,7 +1900,8 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.h
+ [NM_ATT_GSM_TIME] = { TLV_TYPE_FIXED, 2 }, + [NM_ATT_GSM_TIME] = { TLV_TYPE_FIXED, 2 },
+ [NM_ATT_HSN] = { TLV_TYPE_TV }, + [NM_ATT_HSN] = { TLV_TYPE_TV },
+ [NM_ATT_HW_CONFIG] = { TLV_TYPE_TL16V }, + [NM_ATT_HW_CONFIG] = { TLV_TYPE_TL16V },
+ [NM_ATT_HW_DESC] = { TLV_TYPE_TL16V }, + //BS11 [NM_ATT_HW_DESC] = { TLV_TYPE_TL16V },
+ [NM_ATT_HW_DESC] = { TLV_TYPE_TLV },
+ [NM_ATT_INTAVE_PARAM] = { TLV_TYPE_TV }, + [NM_ATT_INTAVE_PARAM] = { TLV_TYPE_TV },
+ [NM_ATT_INTERF_BOUND] = { TLV_TYPE_FIXED, 6 }, + [NM_ATT_INTERF_BOUND] = { TLV_TYPE_FIXED, 6 },
+ [NM_ATT_LIST_REQ_ATTR] = { TLV_TYPE_TL16V }, + [NM_ATT_LIST_REQ_ATTR] = { TLV_TYPE_TL16V },
@ -1964,6 +1968,7 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.h
+ [NM_ATT_BS11_PLL] = { TLV_TYPE_TLV }, + [NM_ATT_BS11_PLL] = { TLV_TYPE_TLV },
+ [NM_ATT_BS11_CCLK_ACCURACY] = { TLV_TYPE_TV }, + [NM_ATT_BS11_CCLK_ACCURACY] = { TLV_TYPE_TV },
+ [NM_ATT_BS11_CCLK_TYPE] = { TLV_TYPE_TV }, + [NM_ATT_BS11_CCLK_TYPE] = { TLV_TYPE_TV },
+ [0x95] = { TLV_TYPE_FIXED, 2 },
+ /* ip.access specifics */ + /* ip.access specifics */
+ [NM_ATT_IPACC_RSL_BSC_IP] = { TLV_TYPE_FIXED, 4 }, + [NM_ATT_IPACC_RSL_BSC_IP] = { TLV_TYPE_FIXED, 4 },
+ [NM_ATT_IPACC_RSL_BSC_PORT] = { TLV_TYPE_FIXED, 2 }, + [NM_ATT_IPACC_RSL_BSC_PORT] = { TLV_TYPE_FIXED, 2 },
@ -1979,10 +1984,22 @@ Index: wireshark/epan/dissectors/packet-gsm_abis_oml.h
+ [NM_ATT_IPACC_UNIT_NAME] = { TLV_TYPE_TL16V }, + [NM_ATT_IPACC_UNIT_NAME] = { TLV_TYPE_TL16V },
+ [NM_ATT_IPACC_SNMP_CFG] = { TLV_TYPE_TL16V }, + [NM_ATT_IPACC_SNMP_CFG] = { TLV_TYPE_TL16V },
+ [NM_ATT_IPACC_ALM_THRESH_LIST]= { TLV_TYPE_TL16V }, + [NM_ATT_IPACC_ALM_THRESH_LIST]= { TLV_TYPE_TL16V },
+ //[0x95] = { TLV_TYPE_FIXED, 2 }, + [NM_ATT_IPACC_CUR_SW_CFG] = { TLV_TYPE_TL16V },
+ [0x9b] = { TLV_TYPE_TL16V },
+ [0x85] = { TLV_TYPE_TV }, + [0x85] = { TLV_TYPE_TV },
+ + [0x9a] = { TLV_TYPE_TL16V },
+ [0x9b] = { TLV_TYPE_TL16V },
+ [0x9c] = { TLV_TYPE_TL16V },
+ [0x9d] = { TLV_TYPE_TL16V },
+ [0x9e] = { TLV_TYPE_TL16V },
+ [0x9f] = { TLV_TYPE_TL16V },
+ [0xa0] = { TLV_TYPE_TL16V },
+ [0xa1] = { TLV_TYPE_TL16V },
+ [0xa2] = { TLV_TYPE_TL16V },
+ [0xa3] = { TLV_TYPE_TL16V },
+ [0xa7] = { TLV_TYPE_TL16V },
+ [0xa8] = { TLV_TYPE_TL16V },
+ [0xa9] = { TLV_TYPE_TL16V },
+ [0xac] = { TLV_TYPE_TL16V },
+ }, + },
+}; +};
+ +