aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-megaco.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-04-24 23:17:44 +0000
committerMichael Mann <mmann78@netscape.net>2013-04-24 23:17:44 +0000
commita18e128b44477f257445bca654d39a7785b3ff7c (patch)
tree22f0b5285af8158187a86664193fdebb306f75a5 /epan/dissectors/packet-megaco.c
parent2d9a44e0fa20c881dc75b487630c55b7af6fe377 (diff)
convert some proto_tree_add_texts into expert_add_info_format. Didn't quite make checkAPIs.pl happy, but given the nature of the dissector (mostly raw text), I'm not sure it can hit the 50% ratio.
svn path=/trunk/; revision=49022
Diffstat (limited to 'epan/dissectors/packet-megaco.c')
-rw-r--r--epan/dissectors/packet-megaco.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/epan/dissectors/packet-megaco.c b/epan/dissectors/packet-megaco.c
index 7b1db38804..17c041408f 100644
--- a/epan/dissectors/packet-megaco.c
+++ b/epan/dissectors/packet-megaco.c
@@ -416,7 +416,7 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb_previous_offset = tvb_find_guint8(tvb, 0,
tvb_len, '/');
if (tvb_previous_offset == -1) {
- proto_tree_add_text(megaco_tree, tvb, 0, -1,
+ expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR,
"Sorry, no \"/\" in the MEGACO header, I can't parse this packet");
return;
}
@@ -440,7 +440,7 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb_current_offset = megaco_tvb_skip_wsp(tvb, tvb_previous_offset);
if (tvb_previous_offset == tvb_current_offset) {
- proto_tree_add_text(megaco_tree, tvb, 0, -1,
+ expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR,
"[ Parse error: missing SEP in MEGACO header ]");
return;
}
@@ -459,7 +459,7 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb_current_offset = tvb_pbrk_guint8(tvb, tvb_current_offset, -1, " \t\r\n", &needle);
if (tvb_current_offset == -1) {
- proto_tree_add_text(megaco_tree, tvb, 0, -1,
+ expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR,
"[ Parse error: no body in MEGACO message (missing SEP after mId) ]");
return;
}
@@ -693,8 +693,8 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default :
ti = proto_tree_add_item(tree,proto_megaco,tvb, 0, -1, ENC_NA);
megaco_tree = proto_item_add_subtree(ti, ett_megaco);
- proto_tree_add_text(megaco_tree, tvb, 0, -1,
- "Sorry, can't understand errorDescriptor / transactionList = %s, can't parse it pos %u",
+ expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR,
+ "Sorry, can't understand errorDescriptor / transactionList = %s, can't parse it pos %u",
tvb_format_text(tvb,tvb_previous_offset,2),tvb_previous_offset);
return;
} /* end switch */
@@ -728,7 +728,7 @@ nextcontext:
tvb_transaction_end_offset, '=')+1;
tvb_previous_offset = megaco_tvb_skip_wsp(tvb, tvb_previous_offset);
if (tvb_current_offset >= tvb_next_offset) {
- proto_tree_add_text(megaco_tree, tvb, 0, 0, "[ Parse error: Invalid offset ]");
+ expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR, "[ Parse error: Invalid offset ]");
return;
}
tvb_current_offset = tvb_next_offset;
@@ -903,13 +903,13 @@ nextcontext:
if ( tempchar == 'P' || tempchar == 'O'){
gint tvb_topology_end_offset = tvb_find_guint8(tvb, tvb_command_start_offset, tvb_transaction_end_offset, '}');
if ( tvb_topology_end_offset == -1 ){
- proto_tree_add_text(megaco_tree, tvb, 0, 0, "[ Parse error: Missing \"}\" ]");
+ expert_add_info_format(pinfo, sub_ti, PI_MALFORMED, PI_ERROR, "[ Parse error: Missing \"}\" ]");
return;
}
tvb_command_start_offset = tvb_find_guint8(tvb, tvb_command_start_offset, tvb_transaction_end_offset, '{');
if ( tvb_command_start_offset == -1 ){
- proto_tree_add_text(megaco_tree, tvb, 0, 0, "[ Parse error: Missing \"{\" ]");
+ expert_add_info_format(pinfo, sub_ti, PI_MALFORMED, PI_ERROR, "[ Parse error: Missing \"{\" ]");
return;
}
dissect_megaco_topologydescriptor(tvb, megaco_tree_command_line, tvb_topology_end_offset-1, tvb_command_start_offset+1);
@@ -955,7 +955,7 @@ nextcontext:
tvb_offset = tvb_find_guint8(tvb, tvb_command_start_offset,
tvb_transaction_end_offset, '=');
if (tvb_offset == -1 ) {
- proto_tree_add_text(megaco_tree, tvb, 0, 0, "[ Parse error: Missing \"=\" ]");
+ expert_add_info_format(pinfo, sub_ti, PI_MALFORMED, PI_ERROR, "[ Parse error: Missing \"=\" ]");
return;
}
tvb_offset = megaco_tvb_skip_wsp_return(tvb, tvb_offset -1);
@@ -1235,13 +1235,13 @@ nextcontext:
tvb_offset = tvb_find_guint8(tvb, tvb_command_start_offset,
tvb_transaction_end_offset, '=');
if (tvb_offset == -1 ) {
- proto_tree_add_text(megaco_tree, tvb, 0, 0, "[ Parse error: Missing \"=\" ]");
+ expert_add_info_format(pinfo, sub_ti, PI_MALFORMED, PI_ERROR, "[ Parse error: Missing \"=\" ]");
return;
}
tvb_offset = megaco_tvb_skip_wsp(tvb, tvb_offset+1);
tokenlen = tvb_next_offset - tvb_offset;
if (tokenlen+1 <= 0) {
- proto_tree_add_text(megaco_tree, tvb, 0, 0, "[ Parse error: Invalid token length (%d) ]", tokenlen+1);
+ expert_add_info_format(pinfo, sub_ti, PI_MALFORMED, PI_ERROR, "[ Parse error: Invalid token length (%d) ]", tokenlen+1);
return;
}
@@ -1257,7 +1257,7 @@ nextcontext:
case 'E':
if ((tokenlen+1 > (int) sizeof(TermID))) {
- proto_tree_add_text(megaco_tree, tvb, 0, 0, "[ Parse error: Invalid TermID length (%d) ]", tokenlen+1);
+ expert_add_info_format(pinfo, sub_ti, PI_MALFORMED, PI_ERROR, "[ Parse error: Invalid TermID length (%d) ]", tokenlen+1);
return;
}
tvb_get_nstringz0(tvb,tvb_offset,tokenlen+1,TermID);
@@ -1455,7 +1455,7 @@ dissect_megaco_descriptors(tvbuff_t *tvb, proto_tree *megaco_tree_command_line,
}
if (tvb_current_offset <= tvb_previous_offset) {
- proto_tree_add_text(megaco_tree_command_line, tvb, 0, 0, "[ Parse error: Invalid offset ]");
+ expert_add_info_format(pinfo, megaco_tree_command_line, PI_MALFORMED, PI_ERROR, "[ Parse error: Invalid offset ]");
return;
}
@@ -2235,7 +2235,7 @@ dissect_megaco_auditdescriptor(tvbuff_t *tvb, proto_tree *megaco_tree, packet_in
tvb_next = tvb_find_guint8(tvb, tvb_offset, tvb_stop, '{'); /* find opening LBRKT - is this already checked by caller?*/
if( tvb_next == -1 ) /* complain and give up if not there */
{
- proto_tree_add_text(megaco_tree, tvb, tvb_offset, tvb_stop+1-tvb_offset, "Badly constructed audit descriptor (no { )");
+ expert_add_info_format(pinfo, megaco_tree, PI_MALFORMED, PI_ERROR, "Badly constructed audit descriptor (no { )");
return;
}
tokenlen = (tvb_stop + 1) - tvb_offset;
@@ -2629,7 +2629,7 @@ dissect_megaco_observedeventsdescriptor(tvbuff_t *tvb, packet_info *pinfo, proto
tvb_current_offset = tvb_observedevents_end_offset;
}
if (tvb_current_offset < tvb_previous_offset) {
- proto_tree_add_text(megaco_observedevent_tree, tvb, 0, 0, "[ Parse error: Invalid offset ]");
+ expert_add_info_format(pinfo, megaco_observedevent_ti, PI_MALFORMED, PI_ERROR, "[ Parse error: Invalid offset ]");
return;
}