Commit Graph

34 Commits

Author SHA1 Message Date
Guy Harris 5cf3fd03f1 HTTPS In More Places, update some URLs.
Change-Id: Ice2e1e2e4d94f6c9da7c651866cfa1a8ac4a31d8
Reviewed-on: https://code.wireshark.org/review/34096
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-27 07:55:36 +00:00
Peter Wu bf0ceafaf9 checkhf.pl: speed up find_remove_ei_defs and remove_if0_code
Remove leading spaces early such that the regex in find_remove_ei_defs
can avoid (falsely) matching every line (saves 97% for packet-rrc.c).
Copy the improved remove_if0_code from checkAPIs.pl (saves 600ms).

packet-ieee80211.c used to spend 240ms and now completes in 165ms.
packet-rrc.c used to spend 53.7s and now completes in 0.85s.

Change-Id: I6469f7c11839fab2f33c49d3c839473f1d4902d2
Reviewed-on: https://code.wireshark.org/review/29795
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-24 17:54:52 +00:00
Dario Lombardo fe71e26af2 spdx: more licenses converted.
Change-Id: I3861061ec261e63b23621799e020e811ed78a343
Reviewed-on: https://code.wireshark.org/review/26333
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-07 15:56:44 +00:00
Peter Wu f1751ef22f checkhf: handle C++-style comments
"tools/checkhf.pl epan/dissectors/packet-umts_fp.c" gave this error:

    Complex regular subexpression recursion limit (32766) exceeded at tools/checkhf.pl line 273.

This is caused by the comment "// ... Indicator's ..." which failed to
match the single-quoted string and caused "catastrophic backtracking".
Solution to fix this case is to disallow unescaped newlines (add "\n" to
the negated character class). Additionally, add logic to remove
C++-style comments for completeness.

Tested against all epan/dissectors/packet-*.c files, the only difference
in output is this umts_fp case, the running time has not regressed.

Change-Id: I7b43e01e1580acf831c0485513135b613bb02e8b
Reported-by: Joerg Mayer
Reviewed-on: https://code.wireshark.org/review/20965
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-08 19:14:00 +00:00
Jeff Morriss aa9f560853 Cleanup and extend the regex for matching expert info entries.
Match each entity in the structure explicitly rather than skipping a bunch at
the end.  This makes it possible to easily (and clearly) specify where we
allow white space.

Don't capture the event group and severity: we don't use them anyway.

Don't put single character matches in []: that makes it hard to read (for
me anyway).

There's no need for both the "m"(ultiline) and "s"(ingle line) options.  Nor
the "o"optimize (make buggy) option.

These same changes should/will be applied to the hf regex later.

Change-Id: I3bf307dcd6432eb1a0c2b9aceea201f8403e08c0
Reviewed-on: https://code.wireshark.org/review/16313
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-10 15:06:20 +00:00
João Valverde 50614a95ba checkhf: Use colon as field separator for better readability
Comma looks like a list when skimming quickly.

Change-Id: Ic0ac1bc8746c70724d2279e3d725c5c9449b79d8
Reviewed-on: https://code.wireshark.org/review/16260
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-03 12:42:03 +00:00
Michael Mann 89896f83d8 Add support in checkhf.pl for expert info.
Basically a copy/paste of the existing hf_ functionality, but looking for ei_ variables instead.

Change-Id: Ic9a34f6bd5dee895fc858bb9631c00271a86486b
Reviewed-on: https://code.wireshark.org/review/15717
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-06-06 11:24:52 +00:00
Michael Mann 004cafd82b Replace HF_EMPTY and ETT_EMPTY with -1
Change-Id: If3e89f8e46edd4eef82037b6b348fd70a9a3033d
Reviewed-on: https://code.wireshark.org/review/7811
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-03-25 01:05:02 +00:00
Bill Meier cdc80af27e checkhf.pl: (Trivial) fix two typos
Change-Id: I2a63127dcf819d671a4c814dcbd82b2dca5022d3
Reviewed-on: https://code.wireshark.org/review/3838
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-25 15:46:10 +00:00
Michael Mann bc40848385 Rework debug_print_hash logic so that it's supported by older versions of perl.
Change-Id: I1720681dc367e01268ffbb1f31035464fa642496
Reviewed-on: https://code.wireshark.org/review/971
Reviewed-by: Michael Mann <mmann78@netscape.net>
Tested-by: Michael Mann <mmann78@netscape.net>
2014-04-05 12:03:49 +00:00
Bill Meier f1f06014c4 (Trivial) Fix a typo.
Change-Id: Ib084b7e9d463c54fc836745833005b1456a82709
Reviewed-on: https://code.wireshark.org/review/518
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-03-05 15:29:57 +00:00
Jeff Morriss 82e2865739 Remove $Id$ and other Subversion leftovers from the tools.
There are a few things in here which could still use attention.

Don't regenerate anything now.

Change-Id: I283c224d3523212144707fca3d6265916cb11792
Reviewed-on: https://code.wireshark.org/review/205
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-02-14 01:35:57 +00:00
Bill Meier 19ffe7eb4c Update a comment; tweak a RegEx.
svn path=/trunk/; revision=47612
2013-02-10 18:40:54 +00:00
Bill Meier 233fcd672f Remove blank lines separately after removing comments rather than as
part of the 'remove comments' regex.

Fixes a bug introduced in SVN #47583 which broke '#if 0' handling.


svn path=/trunk/; revision=47598
2013-02-09 22:14:13 +00:00
Bill Meier 404460c14d Cleanup: Ditch CamelCase; use braces around references.
svn path=/trunk/; revision=47585
2013-02-09 16:28:01 +00:00
Bill Meier 7b40629a16 Fix a syntax error which causes a compile error
(altho not in my version Cygwin Perl V5.14 for some reason).

svn path=/trunk/; revision=47584
2013-02-09 14:52:02 +00:00
Bill Meier 4c41fd5df9 Tweaks to RegEx usage for consistency and performance (and
to fix a monor bug or two).

svn path=/trunk/; revision=47583
2013-02-09 14:25:18 +00:00
Bill Meier f5dd71e30e Fix code to delete blank lines to remove all blank lines;
Update some Perl usage.

svn path=/trunk/; revision=47569
2013-02-08 16:25:46 +00:00
Bill Meier 1e64a82f02 Add addition test to reduce false positives for 'ERROR: NO ARRAY: '
Essentially:
 Detect when an hf_... var is effictively initialized
 via the use of proto_registrar_get_id_byname() or
 proto_get_id_by_filter_name() (instead of
 proto_register_field_array()).

svn path=/trunk/; revision=47542
2013-02-07 22:16:39 +00:00
Bill Meier 669e68dfde Add a hack to fix false positive 'unused ...' related to use of ..._add_oui().
svn path=/trunk/; revision=47536
2013-02-07 19:36:29 +00:00
Bill Meier 64e97d9ec5 Fix a few minor bugs;
Do some small tweaks for readability & consistency.

svn path=/trunk/; revision=47532
2013-02-07 17:17:21 +00:00
Bill Meier 29b72be420 Add checking to verify that global hf_... defs are referenced in hf[] entry in same file.
(Commented out for now since a few false positives are currently generated).

Fix a few minor bugs;
Tweak the calling sequences for various subs.


svn path=/trunk/; revision=47476
2013-02-04 20:06:46 +00:00
Bill Meier 7fa9cf9209 Improvements:
- Handle preprocessed (as well as original) .c source files.
  (Running checkhf on the source after it has been pre-processed
   should give few false positives).
- Remove blank lines, comments & quoted text strings before
   doing the hf_... tests: reduces false positives/negatives.

svn path=/trunk/; revision=47458
2013-02-03 22:12:33 +00:00
Bill Meier d1ae197ae4 Re-implemention of checkhf.pl:
Main objective: reduce the number of false positives.

  (Committed as a patch to the original
   checkhf.pl written by Joerg Mayer so as to
   keep the history for the original program).


svn path=/trunk/; revision=47331
2013-01-28 22:23:32 +00:00
Bill Meier be4c8badd8 Handle hf_... definitions which are not static;
For .../dissectors/(non-generated dissectors):
 Reduces the number of "unused" false positives (and
 adds about 2 different false positives).

svn path=/trunk/; revision=47280
2013-01-25 20:12:09 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Jörg Mayer 462245ba9a Add a few comments and return with an error code if
appropriate, that way the whole stuff gets scriptable.
right now warnings are error code 0 (like completely
fine code).

svn path=/trunk/; revision=34730
2010-10-31 09:05:11 +00:00
Jeff Morriss 53ba99cd9b Say that an hf_ variable is used if we find "variable = hf_variable".
Add some debug statements.
Tweak one regexp to catch more hf_ variable uses.

svn path=/trunk/; revision=34684
2010-10-29 15:15:26 +00:00
Jeff Morriss 6683e22b44 Fix detection of hf entries being used in the hf array where the opening brace
is on the preceding line.  There was code here to do it but it needed to be
moved inside the preceding 'else' (in particular, before the 'next' sent us
around the loop again).

The bug was noticed by Alexis La Goutte in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5329 

svn path=/trunk/; revision=34623
2010-10-22 17:54:08 +00:00
Jörg Mayer e78edf4d28 Small comment fixes
svn path=/trunk/; revision=28519
2009-05-29 10:59:27 +00:00
Anders Broman 996d4db495 Ethereal->Wireshark
svn path=/trunk/; revision=18234
2006-05-28 19:49:07 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Jörg Mayer 33097899f8 Small update
svn path=/trunk/; revision=15860
2005-09-18 21:58:39 +00:00
Jörg Mayer 344fc629fc Add a tool to check the hf_ values.
svn path=/trunk/; revision=15611
2005-08-29 14:15:32 +00:00