aboutsummaryrefslogtreecommitdiffstats
path: root/tools/checkAPIs.pl
AgeCommit message (Collapse)AuthorFilesLines
2016-07-21Add proto_tree_add_checksum.Michael Mann1-1/+1
This is an attempt to standardize display/handling of checksum fields for all dissectors. The main target is for dissectors that do validation, but dissectors that just report the checksum were also included just to make them easier to find in the future. Bug: 10620 Bug: 12058 Ping-Bug: 8859 Change-Id: Ia8abd86e42eaf8ed50de6b173409e914b17993bf Reviewed-on: https://code.wireshark.org/review/16380 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: Michael Mann <mmann78@netscape.net>
2016-05-02Add checkAPI calls to CMake.Graham Bloice1-3/+19
This generates a top level target, checkAPI, that is excluded from the ALL build target, so must be run separately. On Windows using a Visual Studio generator, call msbuild /p:Configuration=RelWithDebInfo checkAPI.vcxproj Change-Id: I44a57c564dcfc75499463b942436f4b920a82478 Reviewed-on: https://code.wireshark.org/review/14873 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2016-04-12checkAPIs: Add links to banned functions.Gerald Combs1-1/+9
Add links to Microsoft's "Security Development Lifecycle (SDL) Banned Function Calls" and "Deprecated CRT Functions". Change-Id: I6f1ffca8158b942fccb982868c6760c2c6e2d97c Reviewed-on: https://code.wireshark.org/review/14881 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-03-05Check source files for broken (read: not set to 8) tabstop settings.Jeff Morriss1-0/+15
Change-Id: I60e77a67189e7446f8c5ffd0add803cca10b4b57 Reviewed-on: https://code.wireshark.org/review/14345 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-09checkAPIs: remove false positive in shadow checkPeter Wu1-1/+1
" strlen (" would match the shadow regex due to backtracking. Disable backtracking with the "possessive quantifier". Change-Id: If5d307fd61f252c41ad6d9b6104d2add1dfa63ae Reviewed-on: https://code.wireshark.org/review/13157 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-01-06checkAPIs: Add "system" to possible shadow variable (on OS X)Alexis La Goutte1-0/+1
See I651e76c6d53b0 Change-Id: I8082f22da0d16655104ad8699f08abdaf916a941 Reviewed-on: https://code.wireshark.org/review/13078 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-27Officially remove tvb_get_string and tvb_get_stringz.Michael Mann1-2/+0
Almost all replacements were done awhile ago, just put the final nail in the coffin. Change-Id: I0a708d886da5a500c2a1e2c9ee2736794bdb9411 Reviewed-on: https://code.wireshark.org/review/12206 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-10-29tools/checkAPIs.pl: improve the hf_ error messagesStefan Metzmacher1-6/+6
Change-Id: Ie8132f317f2d1c27af83218c48874941bd3cc5d0 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-on: https://code.wireshark.org/review/11390 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-09-21Remove proto_tree_add_text API.Michael Mann1-64/+0
Its time has finally come. Technically I just renamed it to proto_tree_add_text_internal and removed the WS_DLL_PUBLIC (so it shouldn't link outside of epan). It's still (legitimately) used by expert.c otherwise I would have made it static within proto.c (and the rename wouldn't have been necessary). Change-Id: I9bdf888d5e92bc7b70a3f5461b9297a66d994b80 Reviewed-on: https://code.wireshark.org/review/10594 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
2015-08-27Remove calls of tvb_ensure_length_remaining.Michael Mann1-1/+0
The remaining calls seem to fall into 3 categories: 1. passing it to tvb_find_line_end when -1 (for length) will do. 2. duplicating the checking of tvb_reported_length_remaining, which is already in use near the tvb_ensure_length_remaining call. 3. Those that (probably) need tvb_ensure_capture_length_remaining Change-Id: I1e77695251e055644bcbbb89f3c181c65d1671ca Reviewed-on: https://code.wireshark.org/review/10268 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>
2015-08-22Correct logic for finding shadow variables.Michael Mann1-1/+1
Change-Id: Ide03c3b92f70d5dad8d0dceca179ea6f3b9e1fd6 Reviewed-on: https://code.wireshark.org/review/10037 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-23CheckAPI: Add a shadow variable checkAlexis La Goutte1-0/+30
Check if there is index, time or strlen variable Change-Id: I530a35d6e1cf13f0795b35579ce76ee373ed4b1a Reviewed-on: https://code.wireshark.org/review/8724 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-27checkAPIs.pl: check how ui class files are includedMartin Kaiser1-10/+31
flag up a warning if a ui class file is included from the current directory by using #include "" Visual Studio needs #include <> to make sure that we always pick up these files from the build directory if we're building with CMake combine this check with the other check for gcrypt.h so that included files are checked in one common subroutine Change-Id: If8420ff5886f8eb2a71aa8fbfe6bc5d2bda607ce Reviewed-on: https://code.wireshark.org/review/9189 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-25Stop using atof/strtod (fixes column sorting of float types)Peter Wu1-0/+1
atof is locale-dependent. In locales such as Swedish, German and Dutch, the dot is a thousand separator, resulting in wrong conversions for floats. While at it, make the mate dissector also be independent of locale. Blacklist atof in checkAPIs. Lemon is still using strtod, but that is not our problem for now. Bug: 11297 Bug: 8964 Change-Id: I6fe3e45eb1d6d95d41aa4f3af1f81a6204a60c63 Reviewed-on: https://code.wireshark.org/review/9116 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-24Remove the last deprecated tvb_length callsEvan Huus1-1/+0
And remove the shims themselves! Change-Id: I511c06eb21eaf68d1dc36bbb9558408807472f9c Reviewed-on: https://code.wireshark.org/review/9088 Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-22checkAPIs.pl: proto_tree_add_bytes_item takes an encoding parameterPascal Quantin1-1/+1
Change-Id: Iebe0e2483d9fd1661bf87ea5efaeb4ae14f6e105 Reviewed-on: https://code.wireshark.org/review/9027 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-04-23Move some checks so they're executed after the comments are removed.Jeff Morriss1-17/+18
We shouldn't complain if someone says "don't use __func__, it's not portable" in a comment. Change-Id: Ib712a00a68c14048eb5d97413a5d5bc0e0812e24 Reviewed-on: https://code.wireshark.org/review/8179 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-04-22Add VALS_EXT_PTR to decorate pointers to value_string_ext's in hfinfo.Jeff Morriss1-1/+1
This allows checkAPIs to continue checking the 'convert' field for correctness when dissectors use value_string_ext_new() to build their value_string_ext's (without resorting to tricks like getting the address of the dereferenced pointer). This will be used to resolve the checkAPIs failure in patch set 3 of Ia5c96b1f6f1fe3a9521b3d70142889e3881fae5e . Change-Id: I700d86b9076f077706d34000f5a6aa5c96351f69 Reviewed-on: https://code.wireshark.org/review/8162 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-19Implement proto_tree_add_item_ret_int() and proto_tree_add_item_ret_uint() whichAndersBroman1-1/+1
works as proto_tree_add_item(), but also returns the value of (u)ints of 8,16,24 and 32 bits length in a 32 bit variable. It's based on Hadriels previous work. Change-Id: If3b4b8588b63251f1ee9b954a202acde7c02ce86 Reviewed-on: https://code.wireshark.org/review/7230 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>
2015-03-05Qt: Add extra related packet indicator types.Gerald Combs1-2/+2
Add the ability to set frame number types: none, request, or response. Use the types to draw different related packet indicators in the packet list. Track the conversation in PacketListRecord. Use it to draw dashed lines for unrelated frames. Set frame number types for DNS and ICMP. Instead of drawing a transparent QImage, alpha blend our foreground color and draw directly in our painter. Blend more toward the foreground color. Add FRAMENUM_TYPE to checkAPIs. Change-Id: I2495945bb436413e05d6ec697184a0b4fd5ad214 Reviewed-on: https://code.wireshark.org/review/7436 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-21checkAPIs: match packet-*.[ch], independent of localePeter Wu1-1/+1
In perl, the \w character group seems to match '-' depending on the locale. On Linux (with the C or en_US.UTF-8 locale), packet-ssl-utils.c does not match. This patch makes the regex match anything except for the path separator. Change-Id: I27543072295af5f2bd5ea8ab36e5d913bebf7d85 Reviewed-on: https://code.wireshark.org/review/7266 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-18Add a CF_FUNC macro for casting BASE_CUSTOM functions.Gerald Combs1-2/+2
Add a CF_FUNC macro to match VALS, TFS, etc. This should help us to avoid the following warning: warning: ISO C forbids initialization between function pointer and 'void *' [-Wpedantic] We could start adding DIAG_OFF+DIAG_ON everywhere but this seems to be more consistent with the other macros in proto.h. Update each instance of BASE_CUSTOM to use CF_FUNC. Adjust a dummy variable name generated by asn2wrs.py that was triggering an invalid error in checkhf.pl. Fix an encoding arguement in packet-elasticsearch.c found by fix-encoding-args.pl. Change-Id: Id0e75076c2d71736639d486f47b87bab84e07d22 Reviewed-on: https://code.wireshark.org/review/7150 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-04emem is dead! Long live wmem!Michael Mann1-4/+0
Change-Id: Iddd1200e62bf3200cb1a68408378dd9d47120b77 Reviewed-on: https://code.wireshark.org/review/6939 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-19Eliminate ep_strdup(), as it's no longer used.Guy Harris1-17/+0
Also, remove some no-longer-existent functions from checkAPIs.pl. Change-Id: I2bf11e3ec03a34f9e89d58d560e340d76fd3ddc1 Reviewed-on: https://code.wireshark.org/review/6645 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18Nobody uses se_ allocations, so remove the code for them.Guy Harris1-18/+1
Don't check for se_ routines in checkAPIs; the failure to compile or link will suffice to catch attempts to use them. Update comments in another test script to reflect the disappearance of the session allocator. Change-Id: If50d953c7130f48b696bc2dd9d327bea2af49bd4 Reviewed-on: https://code.wireshark.org/review/6638 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18Remove ep_strndupMichael Mann1-1/+0
Change-Id: Id336dc16f97a0973754993094aa637813c0ca31c Reviewed-on: https://code.wireshark.org/review/6604 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-17Replace all remaining instances of ep_new with wmem_new and wmem_packet_scope.Michael Mann1-2/+0
Change-Id: I50b2cd0e233554bc58082e96e8d879b40edfc0c1 Reviewed-on: https://code.wireshark.org/review/6595 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-16Kill more unused emem functionsEvan Huus1-3/+0
Change-Id: Ib81410b6d760886f2ae585f44ac58fc135da62c7 Reviewed-on: https://code.wireshark.org/review/6568 Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
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>