diff options
author | Joakim Karlsson <oakimk@gmail.com> | 2016-10-23 01:44:11 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-10-23 10:39:43 +0000 |
commit | 892246acb02868ee4be14543521a20b9818184d6 (patch) | |
tree | 9f58a12d24a5542d0aeb8b5e7a600023c035053b | |
parent | 903eab03798d636cc3cebd1fd08e0097190c745d (diff) |
diameter: improvement of AVP 1066
Printing ascii value in the same way as AVP 1005
Change-Id: I058be87974bf8197e207fdd61be6354031ed8d35
Reviewed-on: https://code.wireshark.org/review/18409
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-diameter_3gpp.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/epan/dissectors/packet-diameter_3gpp.c b/epan/dissectors/packet-diameter_3gpp.c index b458c1a675..27ae2ddf64 100644 --- a/epan/dissectors/packet-diameter_3gpp.c +++ b/epan/dissectors/packet-diameter_3gpp.c @@ -271,6 +271,7 @@ static int hf_diameter_3gpp_imeisv = -1; static int hf_diameter_3gpp_af_charging_identifier = -1; static int hf_diameter_3gpp_af_application_identifier = -1; static int hf_diameter_3gpp_charging_rule_name = -1; +static int hf_diameter_3gpp_monitoring_key = -1; static int hf_diameter_3gpp_mbms_bearer_event = -1; static int hf_diameter_3gpp_mbms_bearer_event_bit0 = -1; static int hf_diameter_3gpp_mbms_bearer_result = -1; @@ -1139,6 +1140,30 @@ dissect_diameter_3gpp_charging_rule_name(tvbuff_t *tvb, packet_info *pinfo _U_, return length; } +/* + * AVP Code: 1066 Monitoring-key + */ +static int +dissect_diameter_3gpp_monitoring_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data) +{ + proto_item *item; + int offset = 0, i; + int length = tvb_reported_length(tvb); + diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data; + + if (tree){ + for (i = 0; i < length; i++) + if (!g_ascii_isprint(tvb_get_guint8(tvb, i))) + return length; + + item = proto_tree_add_item_ret_string(tree, hf_diameter_3gpp_monitoring_key, tvb, offset, length, + ENC_UTF_8 | ENC_NA, wmem_packet_scope(), (const guint8**)&diam_sub_dis->avp_str); + PROTO_ITEM_SET_GENERATED(item); + } + + return length; +} + /* AVP Code: 1082 Credit-Management-Status */ static int dissect_diameter_3gpp_credit_management_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) @@ -1931,7 +1956,10 @@ proto_reg_handoff_diameter_3gpp(void) /* AVP Code: 1005 Charging-Rule-Name */ dissector_add_uint("diameter.3gpp", 1005, create_dissector_handle(dissect_diameter_3gpp_charging_rule_name, proto_diameter_3gpp)); - /* AVP Code: 1005 Credit-Management-Status */ + /* AVP Code: 1066 Monitoring-Key */ + dissector_add_uint("diameter.3gpp", 1066, create_dissector_handle(dissect_diameter_3gpp_monitoring_key, proto_diameter_3gpp)); + + /* AVP Code: 1082 Credit-Management-Status */ dissector_add_uint("diameter.3gpp", 1082, create_dissector_handle(dissect_diameter_3gpp_credit_management_status, proto_diameter_3gpp)); /* AVP Code: 1242 location estimate */ @@ -3414,6 +3442,11 @@ proto_register_diameter_3gpp(void) FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_diameter_3gpp_monitoring_key, + { "Monitoring-Key", "diameter.3gpp.monitoring_key", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, { &hf_diameter_3gpp_mbms_bearer_event, { "MBMS-Bearer-Event", "diameter.3gpp.mbms_bearer_event", FT_UINT32, BASE_HEX, NULL, 0x0, |