summaryrefslogtreecommitdiff
path: root/asn1/gsm_map/gsm_map.cnf
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2014-08-08 09:19:29 -0400
committerMichael Mann <mmann78@netscape.net>2014-08-09 01:57:08 +0000
commitcd02af56a1e39c66b44fd7957aff3b7b77a59e9d (patch)
tree4a3e859751bb73268115a607e9dffcec008bb411 /asn1/gsm_map/gsm_map.cnf
parentbb15274a4a82fcab1c06935fa1e249f436420a02 (diff)
downloadwireshark-cd02af56a1e39c66b44fd7957aff3b7b77a59e9d.tar.gz
Eliminate (almost all) proto_tree_add_text calls from ASN.1 dissectors.
This mostly involved adding expert info capabilities to many of the dissectors so that they could correctly flag error conditions. Only remaining proto_tree_add_text calls are in H248.cnf, which has a convoluted way of using hf_ data to make its tree. Change-Id: I6412150c2ec1977d7fa38f3f0ed416680bdfb141 Reviewed-on: https://code.wireshark.org/review/3500 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'asn1/gsm_map/gsm_map.cnf')
-rw-r--r--asn1/gsm_map/gsm_map.cnf17
1 files changed, 9 insertions, 8 deletions
diff --git a/asn1/gsm_map/gsm_map.cnf b/asn1/gsm_map/gsm_map.cnf
index a187e7a70f..5824c7bb48 100644
--- a/asn1/gsm_map/gsm_map.cnf
+++ b/asn1/gsm_map/gsm_map.cnf
@@ -228,11 +228,12 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS"
#.FN_PARS PrivateExtension/extId FN_VARIANT = _str VAL_PTR = &obj_id
#.FN_BODY PrivateExtension/extType
- proto_tree_add_text(tree, tvb, offset, -1, "Extension Data");
+ proto_tree *ext_tree;
+ ext_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_gsm_map_extention_data, NULL, "Extension Data");
if (obj_id){
- offset=call_ber_oid_callback(obj_id, tvb, offset, actx->pinfo, tree, NULL);
+ offset=call_ber_oid_callback(obj_id, tvb, offset, actx->pinfo, ext_tree, NULL);
}else{
- call_dissector(data_handle, tvb, actx->pinfo, tree);
+ call_dissector(data_handle, tvb, actx->pinfo, ext_tree);
offset = tvb_length_remaining(tvb,offset);
}
@@ -535,15 +536,15 @@ actx->pinfo->p2p_dir = P2P_DIR_RECV;
switch(sms_encoding){
case SMS_ENCODING_7BIT:
case SMS_ENCODING_7BIT_LANG:
- proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %%s", tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, length, ENC_3GPP_TS_23_038_7BITS|ENC_NA));
+ proto_tree_add_string(tree, hf_gsm_map_ussd_string, parameter_tvb, 0, length, tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, length, ENC_3GPP_TS_23_038_7BITS|ENC_NA));
break;
case SMS_ENCODING_8BIT:
/* XXX - ASCII, or some extended ASCII? */
- proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %%s", tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, length, ENC_ASCII|ENC_NA));
+ proto_tree_add_string(tree, hf_gsm_map_ussd_string, parameter_tvb, 0, length, tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, length, ENC_ASCII|ENC_NA));
break;
case SMS_ENCODING_UCS2:
case SMS_ENCODING_UCS2_LANG:
- proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %%s", tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, length, ENC_UCS_2|ENC_BIG_ENDIAN));
+ proto_tree_add_string(tree, hf_gsm_map_ussd_string, parameter_tvb, 0, length, tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, length, ENC_UCS_2|ENC_BIG_ENDIAN));
break;
default:
break;
@@ -741,7 +742,7 @@ if (!actx->value_ptr)
/* TODO: There may be more than one IE */
break;
default:
- proto_tree_add_text(subtree, (tvbuff_t*)actx->value_ptr, 0, length, "If you want this decoded send the packet to Wireshark-dev");
+ proto_tree_add_expert(subtree, actx->pinfo, &ei_gsm_map_undecoded, (tvbuff_t*)actx->value_ptr, 0, length);
break;
}/* switch(octet) */
break;
@@ -821,7 +822,7 @@ if (!actx->value_ptr)
/* TODO: There may be more than one IE */
break;
default:
- proto_tree_add_text(subtree, (tvbuff_t*)actx->value_ptr, 0, length, "If you want this decoded send the packet to Wireshark-dev");
+ proto_tree_add_expert(subtree, actx->pinfo, &ei_gsm_map_undecoded, (tvbuff_t*)actx->value_ptr, 0, length);
break;
}/* switch(octet) */
break;