aboutsummaryrefslogtreecommitdiffstats
path: root/tools/checkAPIs.pl
AgeCommit message (Collapse)AuthorFilesLines
2015-01-12Remove ep_strbuf codeEvan Huus1-10/+0
Thanks to Michael's work, it is now totally unused. Change-Id: I67b5f7c69535a08f96f449c36c429e2548f4ea11 Reviewed-on: https://code.wireshark.org/review/6505 Petri-Dish: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
2015-01-10Remove/replace ep_strsplit()Evan Huus1-1/+0
Change-Id: I4a803d83844d937804849b2ad3b067381c9b96d0 Reviewed-on: https://code.wireshark.org/review/6448 Petri-Dish: Evan Huus <eapache@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-06checkAPIs: C++ comments are allowed in Windows resource files.Gerald Combs1-1/+7
Change-Id: I3885278bf293b1fd7db812ce265734bcdc904c6f Reviewed-on: https://code.wireshark.org/review/6354 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-06Replace ep_address_to_str with address_to_str.Michael Mann1-1/+0
Change-Id: I4f1078b20f41800f72a751612703ad0d4c2ae87b Reviewed-on: https://code.wireshark.org/review/6323 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-31checkAPIs.pl: Error/warnings output goes to STDERRBill Meier1-4/+4
Change-Id: Ib6f460147c26c4fbfb9bd0fd8dd0dd12561be9ea Reviewed-on: https://code.wireshark.org/review/6177 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-28Create FT_FCWWN field type.Michael Mann1-1/+0
Also, convert the "string" hf_ entries that used tvb_fcwwn_to_str as a string to use proto_tree_add_item with FT_FCWWN type. Change-Id: I4ca77870499fd8239584a70874998b5d194a7167 Reviewed-on: https://code.wireshark.org/review/6036 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-28Replace ip6_to_str and ip6_guint8_to_str with address_to_str and tvb_ip_to_str.Michael Mann1-1/+0
Change-Id: I1d258923a7a63539ec8456d3e306bca5016a1e4b Reviewed-on: https://code.wireshark.org/review/6060 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.Michael Mann1-1/+0
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71 Reviewed-on: https://code.wireshark.org/review/5934 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-24Replace fc_to_str with address_to_str or tvb_fc_to_str.Michael Mann1-1/+0
Change-Id: I69bf25f5abb9d6ad325f922fab73b6f0cf8ca2ea Reviewed-on: https://code.wireshark.org/review/6035 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>
2014-12-21Replace ether_to_str with either address_to_str or tvb_ether_to_str.Michael Mann1-1/+0
Change-Id: I8cce9fddbfe950e27e96ea8a5a6d2e0921ff4260 Reviewed-on: https://code.wireshark.org/review/5933 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-09Fix filename matching.Gerald Combs1-1/+1
Change-Id: I2bdfd3ad2798ed1443d06c42b05c9962b8e8041d Reviewed-on: https://code.wireshark.org/review/5689 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-12-08It's a reasonable expectation that we will have C++ style comments inGerald Combs1-1/+1
ui/qt. Change-Id: Iedbf2a2d3cbfee00912e6e883928836932dea566 Reviewed-on: https://code.wireshark.org/review/5678 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-10-30Prohibit ctype APIs (except toupper() which is still used by file.c - makeJeff Morriss1-7/+26
that deprecated). Also remove a few tabs that were in there. Change-Id: I1bb2ad726828366a9f7d1a4064b1215b743ad3b5 Reviewed-on: https://code.wireshark.org/review/5000 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-30Tell the user which file __func__ was found in.Jeff Morriss1-2/+3
Change-Id: Ia69ceaf320cb97447f80a7c090efe6d36262a1c1 Reviewed-on: https://code.wireshark.org/review/5001 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-08-19"Highly discourage" use of proto_tree_add_text.Michael Mann1-1/+3
Change-Id: I2e8d18df71688c654f7acaff51fae7823c08aa6a Reviewed-on: https://code.wireshark.org/review/3677 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-25Replace lseek/fstat by ws_lseek64/ws_fstat64Peter Wu1-0/+2
lseek returns an off_t type which is system-dependent. Use ws_lseek64 in favor of lseek as that supports 64-bit quanities. Use ws_fstat64 instead of stat to support 64-bit file sizes on Windows. For the majority of the changes, this makes no difference as they do not apply to Windows ("ifndef _WIN32"; availability of st_blksize). There are no other users of "struct stat" besides the portability code in wsutil. Forbid the use of fstat and lseek in checkAPIs. Change-Id: I17b930ab9543f21a9d3100f3795d250c9b9ae459 Reviewed-on: https://code.wireshark.org/review/3198 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-16Check for __func__ in checkAPIs.plEvan Huus1-0/+5
Change-Id: I649c69cbf545a8de32d9142c1156db6adb076b63 Reviewed-on: https://code.wireshark.org/review/3078 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-25Update my email address in a couple more spots.Jeff Morriss1-1/+1
Change-Id: I787ae2651a8083bc3082e5cb85dbd849823a16ca Reviewed-on: https://code.wireshark.org/review/2638 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-06-03Add a few more ad-hoc validations of the hf[] FIELDCONVERT field.Bill Meier1-2/+16
Change-Id: Icd817a950331a2e7416a28c3d4a5a004d297e6f9 Reviewed-on: https://code.wireshark.org/review/1845 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-05-07Error out if someone passes the address of a pointer to a *_string to VALS() ↵Jeff Morriss1-0/+8
or RVALS(). Change-Id: I85021b1cba151c16bf0a2d30169cf3dec77780f5 Reviewed-on: https://code.wireshark.org/review/1540 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-25Support out-of-source checkapiStig Bjørlykke1-0/+6
Always call $(top_srcdir)/tools/checkAPIs.pl with -sourcedir=$(srcdir) from Makefile.am to allow out-of-source 'make checkapi'. Change-Id: I60d7e0079984a8ededdacf4517a0738486fa7973 Reviewed-on: https://code.wireshark.org/review/1294 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-19Don't se_ allocate strings when mapping addresses to column strings.Guy Harris1-1/+0
This should significantly reduce memory usage, without increasing the CPU time required to process a capture file in TShark or Wireshark. As a result, se_address_to_str() is no longer used; eliminate it. Fixes bug #9949. Change-Id: I65a112a426c82cc73a957b81384c765c3d14f2c3 Reviewed-on: https://code.wireshark.org/review/1213 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-14Add tvb_get and proto_tree_add for string-encoded timestampsHadriel Kaplan1-1/+1
This commit adds tvb_get_string_time and proto_tree_add_time_item routines for getting nstime fields from the tvb when they are encoded in ASCII string form. The proto_tree_add_time_item routine is also usable for normal big/little-endian encoded time_t, and has the advantage of retrieving the value even if there's no proto tree. It also exposes the routines to Lua, both so that a Lua script can take advantage of this, but also so I can write a testsuite to test the functions. Change-Id: I955da10f68f2680e3da3a5be5ad8fdce7ed6808c Reviewed-on: https://code.wireshark.org/review/1084 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-14Fix Bug 9951: 'git commit hook isn't calling checkAPIs.pl with arguments for ↵Hadriel Kaplan1-0/+14
the dissectors' I recently made a change to packet-rtp.c and inappropriately included g_error() in it, which the builbots caught during their run of checkAPIs.pl. But checkAPIs.pl is supposed to catch such things for us before we submit, by being invoked in the git pre-commit hook. Apparently though, buildbots call checkAPIs.pl with extra arguments for different cases... and for packet dissectors it calls it with a '-g abort' argument, which is how it caught the g_error. So the "bug" is that the pre-commit hook should invoke checAPIs.pl with that argument too, for epan/dissectors/packet-*.c files. Change-Id: Ie8f9dcc55f2248918208dea85a04f67e6bf9829a Reviewed-on: https://code.wireshark.org/review/953 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-02Revert Remove check and inverse code to display a error if there is a $Id$Alexis La Goutte1-1/+4
Change-Id: I7061ad312df5079924c927ca95a8fa111c756012 Reviewed-on: https://code.wireshark.org/review/498 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-01Fix checkApis perl script false positive proto_tree_add with ENC_*Hadriel Kaplan1-1/+2
In epan/proto.c in function proto_tree_add_split_bits_crumb, the proto_tree_add_text function is called with one of its arguments using ENC_BIG_ENDIAN, but it's not an argument for proto_tree_add_text itself but instead a function being called inside it. checkAPIs.pl tries to avoid this in check_proto_tree_add_XXX_encoding, by removing parenthesis arguments, but in this acse there are newlines between the arguments, causing the regex to not catch them. This commit fixes the regex. Change-Id: I70ef79d5436ba2ec04ffdc3d9939c7aa2cdf6a1f Reviewed-on: https://code.wireshark.org/review/902 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-13Fix value_string checks in checkAPIs.pl.Gerald Combs1-2/+2
Some strings contain semicolons, which meant g36db2df was terminating our REs too early. Try terminating them with '}' followed by ';'. Change-Id: I97f63351ef35c91e3123d9abd47576d47fea4b2b Reviewed-on: https://code.wireshark.org/review/638 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-03-13Add a check for newlines in value_strings.Gerald Combs1-81/+118
Update checkAPIs.pl to look for newlines in value_strings and enum_val_t's. We now have to perform the check before we strip quoted strings. Hopefully that won't cause a problem. Rename the check since we do more than check for NULL termination. Add modelines. Fixes bug 9878. Change-Id: I39dd910db60c7028ea4bdb58e8cfdb239c094748 Reviewed-on: https://code.wireshark.org/review/628 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-02-26More tvbuff API deprecation, comment expansion, and documentation updates.Guy Harris1-0/+1
Do with tvb_get_stringz() what was done with tvb_get_string(). Redo the comments for the string get routines to try to give more detail in a fashion that's a bit less hard to read. Warn, in comments, of the problems with using tvb_get_string()/tvb_get_stringz() (i.e., if your strings are non-ASCII, all bytes with the 8th bit set are going be replaced by the Unicode REPLACEMENT CHARACTER, and displayed as such). Warn, in a comment, of the problems with tvb_get_const_stringz() (i.e., it gives you raw bytes, rather than guaranteed-to-be-valid UTF-8). Update documentation and release notes appropriately. Change-Id: Ibd3efb92a203861f507ce71bc8d04d19d9d38a93 Reviewed-on: https://code.wireshark.org/review/327 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-02-22TVB API deprecations and cleanupEvan Huus1-6/+15
- rename tvb_length and similar to tvb_captured_length and similar; leave #defines in place for backwards-compat, but mark them clearly as deprecated in code comments and in checkAPI - remove tvb_get_string as C code and just leave a #define in place for backwards-compat; mark it clearly as deprecated in code comment and checkAPI - update READMEs and sample dissector for all of the above - while in the neighbourhood, make checkAPI skip (and warn) for missing files instead of bailing on the whole check, so subsequent files still get checked Change-Id: I32fc437896ca86ca73e9b49d5f50400adf8ec5ad Reviewed-on: https://code.wireshark.org/review/311 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-13Don't complain if files don't have $Id$ in them.Jeff Morriss1-7/+0
$Id$ is pretty useless in git so don't enforce it in our source code. Change-Id: Ie8b1b9627aabbca72c9c1dd93a9a76901e6967eb Reviewed-on: https://code.wireshark.org/review/203 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2013-12-18Some proto_tree_add_xxx functions have a '_' in the function name so make ↵Michael Mann1-1/+1
sure they get counted in the proto_tree_add_text percentage. Makes a few dissectors look a little better. svn path=/trunk/; revision=54236
2013-11-23Implement address_to_str which is like ep_address_to_str and se_address_to_strEvan Huus1-1/+3
except it takes a wmem scope instead. Add the two emem equivalents to checkAPI as (weakly) deprecated. svn path=/trunk/; revision=53528
2013-10-06Allow a "more complex" algorithm to finding proto_tree_add_text overuse. ↵Michael Mann1-2/+17
Disabled by default, but used when I want to go on an add filterability spree. convert_proto_tree_add_text.pl makes these easier to fix, so why not be pickier about the percentages that dissectors use. svn path=/trunk/; revision=52392
2013-09-16Don't print a warning about missing svn id when the argument is notJörg Mayer1-1/+4
a file. Warn about the "wrong" filetype and continue svn path=/trunk/; revision=52105
2013-09-15Tweak mq macro and checkAPI to avoid false positives - "garbage"Evan Huus1-1/+1
(like a #define) at the beginning of a line before a value_string no longer matches so a #define that includes the beginning of a value_string doesn't confuse the script. svn path=/trunk/; revision=52089
2013-09-15Add help optionJörg Mayer1-16/+29
List options one by one svn path=/trunk/; revision=52068
2013-09-15http://url is NOT a c++ style commentJörg Mayer1-1/+1
svn path=/trunk/; revision=52061
2013-09-13OK, all the Makefiles use -build since r41943, so add that option back for now.Chris Maynard1-1/+3
svn path=/trunk/; revision=52016
2013-09-13Update the comments to match the current usage.Chris Maynard1-1/+4
svn path=/trunk/; revision=52015
2013-09-13Rename --build to --check-addtext/--nocheck-addtext for clarity.Chris Maynard1-9/+15
Add --check-addtext/--nocheck-addtext, --check-hf/--nocheck-hf and --debug to the usage output and format the usage output a little better. svn path=/trunk/; revision=52006
2013-09-05Make checkAPI notify (warnings only, for now) about deprecated emem functions.Evan Huus1-1/+61
svn path=/trunk/; revision=51782
2013-07-05Make checkAPIs.pl a little more discerning when looking for too many ↵Michael Mann1-2/+5
proto_tree_add_text()s. I believe the intent was to ignore "small" dissectors that didn't have enough fields to qualify, but the previous logic ignored dissectors that were (almost) all proto_tree_add_text and no proto_tree_add_xxx. I'm flexible on the definition of "small" (20 "fields"), but I think checkAPIs should flag the "all proto_tree_add_text" dissectors. svn path=/trunk/; revision=50385
2013-03-16flag up a warning if someone includes gcrypt.h instead of wsutil/wsgcrypt.hMartin Kaiser1-0/+24
svn path=/trunk/; revision=48340
2013-02-02Tweaks:Bill Meier1-6/+97
- Remove comments from the input string before checking hf[] entries; - Remove code under '#if 0' before doing API checks. svn path=/trunk/; revision=47447
2012-12-18Don't do proto_tree_add_ether(..., tvb_get_ptr(...)), just use ↵Jeff Morriss1-0/+1
proto_tree_add_item(). svn path=/trunk/; revision=46598
2012-12-02Add SET_ADDRESS and SET_ADDRESS_HF to the list of APIs we (may--if we ↵Jeff Morriss1-1/+3
uncomment the code) check for being called with tvb_get_ptr(). svn path=/trunk/; revision=46326
2012-11-29As requested by Anders on -dev: check enum_val_t's for NULL termination.Jeff Morriss1-0/+34
Also check that they are all const. svn path=/trunk/; revision=46294
2012-09-19Remove #defines that provided backward source compatibilityJörg Mayer1-7/+0
for deprecated dissector add/remmove/... functions. svn path=/trunk/; revision=45000
2012-09-10Use non-capturing grouping when grouping just for alternatives;Bill Meier1-6/+6
Also: improve error message slightly in the case of a missing NULL termination. svn path=/trunk/; revision=44826