diff options
author | Michael Mann <mmann78@netscape.net> | 2013-07-03 23:43:26 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-07-03 23:43:26 +0000 |
commit | 7878e93cad7b9604892a73c6041d352d39acccb9 (patch) | |
tree | b2a1ab23fccbe66387e242bc99b4ceaa350b8582 /asn1 | |
parent | 242e18dace4d2db1c9b1a7345b0a1d25a1bd7f0a (diff) |
expert_add_info_format_text + proto_tree_add_text = proto_tree_add_expert_format, where applicable.
svn path=/trunk/; revision=50377
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/camel/camel.cnf | 18 | ||||
-rw-r--r-- | asn1/gsm_map/packet-gsm_map-template.c | 17 | ||||
-rw-r--r-- | asn1/inap/inap.cnf | 17 | ||||
-rw-r--r-- | asn1/snmp/snmp.cnf | 11 |
4 files changed, 21 insertions, 42 deletions
diff --git a/asn1/camel/camel.cnf b/asn1/camel/camel.cnf index 43002894d9..06d1f9e07d 100644 --- a/asn1/camel/camel.cnf +++ b/asn1/camel/camel.cnf @@ -110,7 +110,6 @@ static const value_string camel_err_code_string_vals[] = { # #.TABLE2_HDR static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) { - proto_item *cause; switch(opcode){ #.TABLE2_BODY OPERATION.&ArgumentType @@ -119,9 +118,8 @@ static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ break; #.TABLE2_FTR default: - cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob"); - proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN); - expert_add_info_format_text(actx->pinfo, cause, &ei_camel_unknown_invokeData, "Unknown invokeData %d",opcode); + proto_tree_add_expert_format(tree, actx->pinfo, &ei_camel_unknown_invokeData, + tvb, offset, -1, "Unknown invokeData %d", opcode); /* todo call the asn.1 dissector */ break; } @@ -130,7 +128,6 @@ static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ #.END #.TABLE2_HDR static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx) { - proto_item *cause; switch(opcode){ #.TABLE2_BODY OPERATION.&ResultType @@ -139,16 +136,14 @@ static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset, break; #.TABLE2_FTR default: - cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnResultData blob"); - proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN); - expert_add_info_format_text(actx->pinfo, cause, &ei_camel_unknown_returnResultData, "Unknown returnResultData %d",opcode); + proto_tree_add_expert_format(tree, actx->pinfo, &ei_camel_unknown_returnResultData, + tvb, offset, -1, "Unknown returnResultData %d",opcode); } return offset; } #.END #.TABLE2_HDR static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx) { - proto_item *cause; switch(errorCode) { #.TABLE2_BODY ERROR.&ParameterType @@ -157,9 +152,8 @@ static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,a break; #.TABLE2_FTR default: - cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnErrorData blob"); - proto_item_set_expert_flags(cause, PI_MALFORMED, PI_WARN); - expert_add_info_format_text(actx->pinfo, cause, &ei_camel_unknown_returnErrorData, "Unknown returnErrorData %d",errorCode); + proto_tree_add_expert_format(tree, actx->pinfo, &ei_camel_unknown_returnErrorData, + tvb, offset, -1, "Unknown returnErrorData %d",errorCode); } return offset; } diff --git a/asn1/gsm_map/packet-gsm_map-template.c b/asn1/gsm_map/packet-gsm_map-template.c index 849b2b4d34..c9295114bd 100644 --- a/asn1/gsm_map/packet-gsm_map-template.c +++ b/asn1/gsm_map/packet-gsm_map-template.c @@ -1005,8 +1005,6 @@ static int dissect_mc_message(tvbuff_t *tvb, static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) { - proto_item *cause; - switch(opcode){ case 2: /*updateLocation*/ offset=dissect_gsm_map_ms_UpdateLocationArg(FALSE, tvb, offset, actx, tree, -1); @@ -1353,8 +1351,8 @@ static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ break; default: if(!dissector_try_uint(map_prop_arg_opcode_table, (guint8)opcode, tvb, actx->pinfo, tree)){ - cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob"); - expert_add_info_format_text(actx->pinfo, cause, &ei_gsm_map_unknown_invokeData, "Unknown invokeData %d",opcode); + proto_tree_add_expert_format(tree, actx->pinfo, &ei_gsm_map_unknown_invokeData, + tvb, offset, -1, "Unknown invokeData %d", opcode); } offset+= tvb_length_remaining(tvb,offset); break; @@ -1365,8 +1363,6 @@ static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) { - proto_item *cause; - switch(opcode){ case 2: /*updateLocation*/ offset=dissect_mc_message(tvb, offset, actx, tree, @@ -1660,8 +1656,8 @@ static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset, default: if(!dissector_try_uint(map_prop_res_opcode_table, (guint8)opcode, tvb, actx->pinfo, tree)){ - cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnResultData blob"); - expert_add_info_format_text(actx->pinfo, cause, &ei_gsm_map_unknown_invokeData, "Unknown invokeData %d",opcode); + proto_tree_add_expert_format(tree, actx->pinfo, &ei_gsm_map_unknown_invokeData, + tvb, offset, -1, "Unknown returnResultData %d", opcode); } offset+= tvb_length_remaining(tvb,offset); break; @@ -1672,7 +1668,6 @@ static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset, static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) { - proto_item *cause; switch(errorCode){ case 1: /* UnknownSubscriberParam */ @@ -1824,8 +1819,8 @@ static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset, break; default: if(!dissector_try_uint(map_prop_err_opcode_table, (guint8)opcode, tvb, actx->pinfo, tree)){ - cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnErrorData blob"); - expert_add_info_format_text(actx->pinfo, cause, &ei_gsm_map_unknown_invokeData, "Unknown invokeData %d",errorCode); + proto_tree_add_expert_format(tree, actx->pinfo, &ei_gsm_map_unknown_invokeData, + tvb, offset, -1, "Unknown returnErrorData %d", opcode); } offset+= tvb_length_remaining(tvb,offset); break; diff --git a/asn1/inap/inap.cnf b/asn1/inap/inap.cnf index 5756f59fa4..34b5659b77 100644 --- a/asn1/inap/inap.cnf +++ b/asn1/inap/inap.cnf @@ -76,7 +76,6 @@ static const value_string inap_err_code_string_vals[] = { # #.TABLE2_HDR static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) { - proto_item *cause; switch(opcode){ #.TABLE2_BODY OPERATION.&ArgumentType @@ -85,8 +84,8 @@ static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ break; #.TABLE2_FTR default: - cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown invokeData blob"); - expert_add_info_format_text(actx->pinfo, cause, &ei_inap_unknown_invokeData, "Unknown invokeData %d",opcode); + proto_tree_add_expert_format(tree, actx->pinfo, &ei_inap_unknown_invokeData, + tvb, offset, -1, "Unknown invokeData %d", opcode); /* todo call the asn.1 dissector */ break; } @@ -95,8 +94,6 @@ static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ #.END #.TABLE2_HDR static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx) { - proto_item *cause; - switch(opcode){ #.TABLE2_BODY OPERATION.&ResultType case %(&operationCode)s: /* %(_ident)s */ @@ -104,16 +101,14 @@ static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset, break; #.TABLE2_FTR default: - cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnResultData blob"); - expert_add_info_format_text(actx->pinfo, cause, &ei_inap_unknown_returnResultData, "Unknown returnResultData %d",opcode); + proto_tree_add_expert_format(tree, actx->pinfo, &ei_inap_unknown_returnResultData, + tvb, offset, -1, "Unknown returnResultData %d", opcode); } return offset; } #.END #.TABLE2_HDR static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx) { - proto_item *cause; - switch(errorCode) { #.TABLE2_BODY ERROR.&ParameterType case %(&errorCode)s: /* %(_ident)s */ @@ -121,8 +116,8 @@ static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,a break; #.TABLE2_FTR default: - cause=proto_tree_add_text(tree, tvb, offset, -1, "Unknown returnErrorData blob"); - expert_add_info_format_text(actx->pinfo, cause, &ei_inap_unknown_returnErrorData, "Unknown returnErrorData %d",errorCode); + proto_tree_add_expert_format(tree, actx->pinfo, &ei_inap_unknown_returnErrorData, + tvb, offset, -1, "Unknown returnErrorData %d", opcode); } return offset; } diff --git a/asn1/snmp/snmp.cnf b/asn1/snmp/snmp.cnf index 49c542d95c..65d4a2433c 100644 --- a/asn1/snmp/snmp.cnf +++ b/asn1/snmp/snmp.cnf @@ -130,11 +130,8 @@ gint pdu_type=-1; tvbuff_t* cleartext_tvb = usm_p.user_assoc->user.privProtocol(&usm_p, crypt_tvb, &error ); if (! cleartext_tvb) { - proto_item* cause = proto_tree_add_text(encryptedpdu_tree, crypt_tvb, 0, -1, - "Failed to decrypt encryptedPDU: %%s", error); - - expert_add_info_format_text(actx->pinfo, cause, &ei_snmp_failed_decrypted_data_pdu, - "Failed to decrypt encryptedPDU: %%s", error); + proto_tree_add_expert_format(encryptedpdu_tree, actx->pinfo, &ei_snmp_failed_decrypted_data_pdu, + crypt_tvb, 0, -1, "Failed to decrypt encryptedPDU: %%s", error); col_set_str(actx->pinfo->cinfo, COL_INFO, "encryptedPDU: Failed to decrypt"); @@ -194,9 +191,7 @@ gint pdu_type=-1; usm_p.authOK = usm_p.user_assoc->user.authModel->authenticate( &usm_p, &calc_auth, &calc_auth_len, &error ); if (error) { - authen_item = proto_tree_add_text(authen_tree,tvb,0,0,"Error while verifying Message authenticity: %s", error); - PROTO_ITEM_SET_GENERATED(authen_item); - expert_add_info_format_text( actx->pinfo, authen_item, &ei_snmp_verify_authentication_error, "Error while verifying Message authenticity: %s", error ); + expert_add_info_format_text( actx->pinfo, usm_p.auth_item, &ei_snmp_verify_authentication_error, "Error while verifying Message authenticity: %s", error ); } else { expert_field* expert; |