Trying to submit Control Techniques packet-ecmp.c dissector as a built-in. Wireshark team requested that I run the checkAPIs tool on the source file. It gave this result. $ checkAPIs.pl packet-ecmp.c packet-ecmp.c: found 324 useless add_text() vs. 119 add_<something else="">() calls (272.27%) $ Checked this with the Visual C++ editor and essentially all the flagged lines are references to proto_tree_add_text(...) source lines. Latest copy of README.dissector shows this proto_tree_add_text() function as legal and acceptable. There are several functions that the programmer can use to add either protocol or field labels to the proto_tree: proto_item proto_tree_add_item(tree, id, tvb, start, length, encoding); proto_item proto_tree_add_text(tree, tvb, start, length, format, ...); OK, what gives? This question is marked "community wiki". asked 26 Sep '14, 07:41 lynchzilla edited 26 Sep '14, 08:47 |
One Answer:
proto_tree_add_text() has long been on the list of APIs to avoid and we've been slowly replacing most calls to it with better APIs (ones which make the field filterable). As README.dissector says (in master-1.12):
The current README.dissector (in master) doesn't even mention proto_tree_add_text() any more. (Keep in mind that new dissectors are submitted against master, not one of the release branches.) answered 26 Sep '14, 08:48 JeffMorriss ♦ |