Commit Graph

232 Commits

Author SHA1 Message Date
Gerald Combs 194b3b406a Update our issue tracker URL in some places.
Replace bugs.wireshark.org links with their equivalent
gitlab.com/wireshark/wireshark/issues links in the AsciiDoctor buglink
macro and the please_report_bug function. Update the bug URLs in
comments in the tools and test directories.
2020-09-16 01:29:07 +00:00
Gerald Combs 7ab6440416 Tools: Clean up checkAPI and add ui/qt.
Remove the --check-addtext and --build flags. They were used for
checkAddTextCalls, which was removed in e2735ecfdd.

Add the sources in ui/qt except for qcustomplot.{cpp,h}. Fix issues in
main.cpp, rtp_audio_stream.cpp, and wireshark_zip_helper.cpp.

Rename "index"es in packet-usb-hid.c.
2020-09-05 07:41:29 +00:00
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
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
João Valverde c7d86568a0 CMake: Remove wsutil pcap dependency
Change-Id: Ic5a3653cb8bcc33e0be108c8b201567e7090f9f5
Reviewed-on: https://code.wireshark.org/review/33043
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: João Valverde <j@v6e.pt>
2019-05-03 21:57:05 +00:00
Gerald Combs bd75f5af0a checkAPIs: Check for non-UTF-8 instead of non-ASCII.
Replace our check for non-ASCII characters with one that checks for a
proper UTF-8 encoding.

Change-Id: I8386f5d4376b05bc10358c0d2849a214d8ff00a0
Reviewed-on: https://code.wireshark.org/review/32866
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-04-19 21:32:29 +00:00
Peter Wu 52d60cac72 checkAPIs.pl: fix false positive in value_string.h
check_value_string_arrays accidentally considered a part of
value_string.h as value_string definition:

    Error: epan/value_string.h                : {0, NULL} is required as the last value_string array entry: value_string array_name[]
    #define _VS_ARRAY_TYPE_NAME(array_name) const value_string array_name[]

    #define _VS_ENUM_ENTRY( name, value, string) name

Stripping all pre-processor statements (like #define) would be one way
to solve it, but at least one function checks for the presence of a
macro, so instead forbid '#' in the regex for variable name.

Change-Id: I4f47b3a42714c5bc526b0ecd8d2fb1ab076d00a2
Fixes: v2.9.0rc0-1929-g73644b3f76 ("checkAPIs.pl: speed up check_value_string_arrays and remove_if0_code")
Reviewed-on: https://code.wireshark.org/review/30391
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-10-26 14:28:00 +00:00
Jeff Morriss 5188a1a38e checkAPIs: check ett variable registrations.
Using unregistered etts leads to an abort so check for them in checkAPIs.
This does slow down checkAPIs by about 15% but it seems a reasonable cost
for the benefit.

Note that finding ett registration blocks was fairly inaccurate so we
just check for whether ett variable addresses are used - on the assumption
that if someone's using the address they're probably using it to register
the ett.

Change-Id: Ifbac75c4a8a0fdb27d9c9d1584a2de791bfbc118
Reviewed-on: https://code.wireshark.org/review/30293
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-21 06:57:33 +00:00
Jeff Morriss 451b93ed99 checkAPIs: use new regex to remove comments.
The new pattern is from the Perl FAQ; it works better for me than the
old code.  Of note is that it works with C++/C99-style comments
following a statement (as opposed to at the start of a line).

The new regex is only slightly slower than the old one: `make checkAPI`
goes from 3m30s of user time to 3m35s.

The big functional difference can be seen by looking at the
post-removal contents of packet-hl7.c.

Before:

    struct msh {                    // typical/default values
        char field_separator;       //
        char component_separator;   //
        char repetition_separator;  //
        char escape_character;      // &\0\0MSH\0\0';
                    if (tree) {

(With the old regex we lost a lot of code!)

After:

    struct msh {
        char field_separator;
        char component_separator;
        char repetition_separator;
        char escape_character;
        char subcomponent_separator;
        char message_type[4];
        char trigger_event[4];
    };

Change-Id: Iac35413d480cc7b05b820cb3b292f87ed30e6801
Reviewed-on: https://code.wireshark.org/review/30265
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-20 06:59:20 +00:00
Peter Wu 353ad11974 checkAPIs.pl: check for return/goto in TRY/CATCH blocks
As documented in epan/exceptions.h, return/goto should never be used in
a TRY/CATCH/FINALLY block as ENDTRY must be executed first. Additionally
clamp the exit code since values larger than 255 will wrap around. Use a
small value as shells typically use 128+signal for termination signals.

Verified against packet-t125.c and ftype-protocol.c while they suffered
from the return bug. Tested against packet-gssapi.c for lack of false
positives (goto with labels within the function) and against:

    int main() {
        TRY {
            goto bar;
            goto omg;
            goto bar;
            goto barrie;
    barrie: ;
        } ENDTRY;
    bar: meh;
    }

Change-Id: I44484add34e238e07a84fc2c74b69f50ba6dc3f3
Ping-Bug: 15189
Reviewed-on: https://code.wireshark.org/review/30097
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-10 04:07:20 +00:00
Peter Wu 73644b3f76 checkAPIs.pl: speed up check_value_string_arrays and remove_if0_code
The initial execution time on packet-ieee80211.c was 940ms. Optimize:
- Assume that "static const value_string ... = { ... };" does not have
  other preceding stuff (including optional whitespace). This speeds up
  check_value_string_arrays and reduces runtime by 440ms to 500ms.
- Rewrite remove_if0_code to avoid invoking a substitution for every
  line. This reduces runtime by 130ms to 370ms.

packet-rrc.c used to take 9.4s. The fixes improved it to 3.0s and 2.8s.

Change-Id: Ifc7efa447d64dccba3e211f0741099451b61b95a
Reviewed-on: https://code.wireshark.org/review/29794
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-24 04:03:50 +00:00
Peter Wu 1a63f1ca9b checkAPIs.pl: improve value_string validation in field definitions
Use of 32-bit value_string for 64-bit fields currently results in a
runtime error during use, better catch it earlier. Use of 64-bit
val64_string without BASE_VAL64_STRING will probably crash.

Since many dissectors use no macro for value_string_ext, accept both
VALS_EXT_PTR(x) and &x forms.

Change-Id: I59a3f67425e7c00bdd54cbffd91e498ee0b078cd
Reviewed-on: https://code.wireshark.org/review/29756
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-20 23:01:03 +00:00
Peter Wu 54f106fb9c checkAPIs.pl: recognize fields with spaces in display
Fields with display values such as "BASE_RANGE_STRING | BASE_DEC" used
to be ignored, make sure that the regex detects such fields.

Change-Id: I80d4331e3fb75092ffd768dabb85c5f13c9b5462
Reviewed-on: https://code.wireshark.org/review/29755
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-20 23:00:19 +00:00
Peter Wu c768cf5503 checkAPIs.pl: support for new-style dissectors in check_hf_entries
Tested with dissectors like epan/dissectors/packet-netlink-sock_diag.c.

Change-Id: Icb43892d68896a8f61f4c0caf413327f0479f007
Reviewed-on: https://code.wireshark.org/review/29754
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-20 22:59:58 +00:00
Gerald Combs 8f08a4e74e Try to discourage the use of APIs via counting.
Add the ability to specify maximum function counts for each group to
checkAPIs. Add maximum counts for the "termoutput" and "abort" groups
where needed. Show summaries in various checkAPI targets.

Switch uses of ws_g_warning back to plain g_warning.

Change-Id: I5cbddc8c671729e424eed8551f69116d16491976
Reviewed-on: https://code.wireshark.org/review/29721
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-09-19 16:07:03 +00:00
Guy Harris 57e2e0c10d Update some comments.
(Wireshark hasn't been strictly a C program for a while, and we now
allow C99-and-later comments in the C code.)

Change-Id: Ic68e053eed7aae1971a800cf74135bc86d211e97
Reviewed-on: https://code.wireshark.org/review/27520
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-14 07:04:03 +00:00
Peter Wu 5e5cc440a2 checkAPIs: handle C++ / C99-style '//' comments
Avoids a warning in epan/dissectors/packet-enip.c due to "time"
appearing in a comment.

Change-Id: I88b6856425c09fc3b8cb2edc345047062a07b662
Reviewed-on: https://code.wireshark.org/review/27516
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-14 06:54:19 +00:00
Guy Harris 02a67d4e1e Report the file name in the "#if/#endif mismatch" error.
Change-Id: I54d2b98e471e04a2ad0a8ecc036180af04bb8359
Reviewed-on: https://code.wireshark.org/review/27394
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-08 09:15:34 +00:00
Peter Wu 4694c7acf0 checkAPIs.pl: fix false positive with C++ method names
Fix false positives due to method names that are considered deprecated:

    int CaptureFileDialog::open(...
    first_elapsed = QString().sprintf(
    int open(QString &file_name, unsigned int &type);

Change-Id: Ib3c255a9f17b2cb44cd441e5277a97db63afaa72
Reviewed-on: https://code.wireshark.org/review/27189
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-04-30 10:37:35 +00:00
Joerg Mayer 7853d0e354 Remove a few obsolete references to gtk from checkapi and faq.py
Change-Id: Ice9aec64fddbed94c7be96575c6e1bc800e8ac9e
Reviewed-on: https://code.wireshark.org/review/27067
Petri-Dish: Jörg Mayer <jmayer@loplof.de>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2018-04-21 23:34:40 +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
Dario Lombardo 43833239fc Qt: change obsolete qVariantFromValue into QVariant::fromValue.
Change-Id: I767b06c0e316347cdb28b769f1032e6d44cba45b
Reviewed-on: https://code.wireshark.org/review/25321
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-15 12:20:32 +00:00
João Valverde 46f4664b29 checkAPI: error out on empty filelist
This will help detect some bogus checkapi runs in the future.

Change-Id: I43345e3a0a5471e9655f34e36ccf1562d6526758
Reviewed-on: https://code.wireshark.org/review/23946
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-16 23:07:09 +00:00
Ahmad Fatoum 6d8f3ddc7c checkAPIs.pl: Don't check prefs.[ch] for duplicate registered variables
Change-Id: I389aa31db4da11b2b1e8d009a4cfeca03b587f45
Reviewed-on: https://code.wireshark.org/review/23014
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Ahmad Fatoum <ahmad@a3f.at>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-08 15:07:26 +00:00
Ahmad Fatoum 1089bdb7d4 checkAPIs.pl: Detect multiple preferences with same variable
Catches mistakes where the same variable is populated by multiple preferences:
prefs_register_bool_preference(epl_module, "show_soc_flags", "text1", "desc1",
    &show_soc_flags);
prefs_register_bool_preference(epl_module, "show_soa_flags", "text2", "desc2",
    &show_soc_flags);

Change-Id: I77a9432d9b518e951166c93a890a948d3f228162
Reviewed-on: https://code.wireshark.org/review/22974
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-07 23:07:24 +00:00
João Valverde 7466880e8a Parse enterprise-numbers at run time
"enterprise-numbers" is converted to tab-separated values and renamed
"enterprises". Unused fields are stripped.

PENs are stored in a hash table loaded at run-time.

User "enterprises" file is loaded from the personal config dir.

Misc make-sminmpec.pl improvements and fixes.
Note: names of type "Entity (formerly ...)" have the formerly part commented out for a cleaner output.

Change-Id: I60c533afbe3e399077fbf432088064471ad3e1e2
Reviewed-on: https://code.wireshark.org/review/22246
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: João Valverde <j@v6e.pt>
2017-06-26 22:40:50 +00:00
Michael Mann dd2b1d5880 checkAPIs.pl: Add check to make sure tvb_get_ function isn't used in proto_tree_add_xxx
Check for situations for things like proto_tree_add_uint, where the "uint" passed
is a call to tvb_get_ntohl().  For that, proto_tree_add_item should be used.

Change-Id: Ibe14678bd66b05f612b125ca289f671c499a2990
Reviewed-on: https://code.wireshark.org/review/21685
Petri-Dish: Anders Broman <a.broman58@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>
2017-05-25 11:40:04 +00:00
Guy Harris 7321183716 Put the HAVE_REMOTE hack into wsutil/wspcap.h, and include that file.
Have a header file that defines HAVE_REMOTE if HAVE_PCAP_REMOTE is
defined, and then includes pcap.h.  Replace all other includes of
pcap.h, and the definition of HAVE_REMOTE, with includes of that file.
Check for anything other than wspcap.h including pcap.h in checkAPIs.pl.

Change-Id: I3cbee8208944ad6f006f568b3fe3134e10b2a883
Reviewed-on: https://code.wireshark.org/review/21605
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-11 19:58:15 +00:00
Guy Harris 357cfd3b03 A bunch of "{Mac} OS X" -> "macOS" changes.
Avoid anachronisms, however; there was no "macOS 10.0" or even "OS X
10.0", for example.  It was "Mac OS X" until 10.8 (although 10.7 was
sometimes called "OS X" and sometimes called "Mac OS X"), and it was "OS
X" from 10.8 to 10.11.

Change-Id: Ie4a848997dcc6c45c2245c1fb84ec526032375c3
Reviewed-on: https://code.wireshark.org/review/20933
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-05 19:16:22 +00:00
Peter Wu 641a48ec68 checkAPIs: improve trailing item suggestion for XXX_string
Tighten the check (do not just check for "0,NULL}};" but also
"{0,NULL}};" in case someone decides to use "{0x10,NULL}};" as trailing
item. Improve the suggestion, "{NULL,NULL}" is better for string_string
than "{0,NULL}".

For now treat 0 the same as NULL since files like packet-fix.h would
need editing otherwise. Accept octal notation for value_string since
packet-nfs.c uses this in nfs2_mode_names.

Change-Id: Ic507dbd8b07f3ae062b3f0310aa3398115d54273
Reviewed-on: https://code.wireshark.org/review/20796
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-03-31 09:17:42 +00:00
Peter Wu 483daa4d27 checkAPIs.pl: check value_string termination
Check for the expected "{0, NULL}" termination, disallowing things like
"{9, NULL}". Also add val64_string and bytes_string while at it. Remove
a stale comment since we allow some c99 syntax now.

Change-Id: I1685255bbb11d84eba46b7cd00934d2f74187e03
Reviewed-on: https://code.wireshark.org/review/20792
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-29 20:11:07 +00:00
Dario Lombardo 7dfaab3cf7 checkAPI: move atoi from soft-deprecated to prohibited.
The atoi function has been completely removed from the tree.
It's still present in the GTK code, but, since GTK compilation
has been removed in the default, checkAPI target doesn't complain,
as well as the buildbot.

Change-Id: I436d6f333b99b9188734155c1f92273420354947
Reviewed-on: https://code.wireshark.org/review/18432
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-10-27 15:11:06 +00:00
Dario Lombardo 3fce8da341 checkAPI: move atoi from deprecated to soft-deprecated list.
atoi must lie in soft-deprecated list until close to complete removal.

Change-Id: Ia26ada56114559637fdc598913ee93523ed9434d
Reviewed-on: https://code.wireshark.org/review/17529
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: 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-09-06 12:31:02 +00:00
Peter Wu 232a879429 Allow a lot more C99 features
Flexible array members are supported by gcc, clang and even MSVC2013.
Note, so far it was only used in the Windows-specific airpcap.h.

Trailing commas in enum declaration are already in use since for
these dissectors (commit ID is the first occurrence):
epan/dissectors/packet-gluster.h v2.1.0rc0-1070-g3b706ba
epan/dissectors/packet-ipv6.c v2.1.2rc0-81-ge07b4aa
epan/dissectors/packet-netlink.h v2.3.0rc0-389-gc0ab12b
epan/dissectors/packet-netlink-netfilter.c v2.3.0rc0-239-g1767e08
epan/dissectors/packet-netlink-route.c v2.3.0rc0-233-g2a80b40
epan/dissectors/packet-quic.c v2.3.0rc0-457-gfa320f8

Inline functions using the "inline" keyword are supported via all glib
versions we support (if it is missing, glib will define a suitable
inline macro).

Other c99 functions listed in the README.developer document were found
to be compatible with GCC 4.4.7, Clang 3.4.2 and MSVC 2013.

Change-Id: If5bab03bfd8577b15a24bedf08c03bdfbf34317a
Reviewed-on: https://code.wireshark.org/review/17421
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-06 02:42:27 +00:00
Dario Lombardo 474199a974 checkAPI: add deprecated atoi.
Instead use ws_strtoi/u functions. atoi() doesn't make any kind
of check so it should be avoided. ws_strtoi/u should be used
instead of strtol & co., but they're still acceptable for some
cases that deviate from the basic usage.

Change-Id: I145ff4d8f893852e024c4ea8fc6a836b15bd2b0d
Reviewed-on: https://code.wireshark.org/review/17502
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-05 16:37:12 +00:00
Michael Mann ad6fc87d64 Add proto_tree_add_checksum.
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-07-21 12:35:22 +00:00
Graham Bloice 2e23b506c7 Add checkAPI calls to CMake.
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-05-02 12:01:24 +00:00
Gerald Combs 8710ce0205 checkAPIs: Add links to banned functions.
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-04-12 04:06:24 +00:00
Jeff Morriss be25474c94 Check source files for broken (read: not set to 8) tabstop settings.
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-03-05 17:46:00 +00:00
Peter Wu 41e93ead25 checkAPIs: remove false positive in shadow check
" 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-09 20:02:01 +00:00
Alexis La Goutte 3239d02bc9 checkAPIs: Add "system" to possible shadow variable (on OS X)
See I651e76c6d53b0

Change-Id: I8082f22da0d16655104ad8699f08abdaf916a941
Reviewed-on: https://code.wireshark.org/review/13078
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-06 21:41:38 +00:00
Michael Mann 3606f80d9e Officially remove tvb_get_string and tvb_get_stringz.
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-11-27 05:11:25 +00:00
Stefan Metzmacher 8c48529d3a tools/checkAPIs.pl: improve the hf_ error messages
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-10-29 12:29:48 +00:00
Michael Mann e2735ecfdd Remove proto_tree_add_text API.
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-09-21 14:11:43 +00:00
Michael Mann 0af048b7e4 Remove calls of tvb_ensure_length_remaining.
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-27 04:34:10 +00:00
Michael Mann 0d61321f69 Correct logic for finding shadow variables.
Change-Id: Ide03c3b92f70d5dad8d0dceca179ea6f3b9e1fd6
Reviewed-on: https://code.wireshark.org/review/10037
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-08-22 12:31:06 +00:00
Alexis La Goutte 1ddf1cfeb0 CheckAPI: Add a shadow variable check
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-07-23 15:53:38 +00:00
Martin Kaiser 48f7ce79e2 checkAPIs.pl: check how ui class files are included
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-27 16:25:41 +00:00
Peter Wu 3f5d183a44 Stop using atof/strtod (fixes column sorting of float types)
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-25 15:38:45 +00:00
Evan Huus 95ac3908d8 Remove the last deprecated tvb_length calls
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-24 17:32:40 +00:00