Commit Graph

244 Commits

Author SHA1 Message Date
João Valverde 02238edf92 Do not require using wsgcrypt.h
The reason to use wsgcrypt.h was to wrap it around DIAG_OFF()
macros and that should no longer be necessary.
2023-02-06 15:52:10 +00:00
João Valverde 71cfbd81b3 Remove wspcap.h and use config.h instead
Forcing the use of a dedicated header to replace pcap.h is
unnecessary code and mental overhead in this case. We can
use config.h instead for the same purpose of defining a
macro symbol before including pcap.h.
2023-02-06 15:05:36 +00:00
j.novak@netsystem.cz 6c9cb8f3fa Prefs/Extcap: Added support for password which is never stored on the disk 2021-12-30 16:03:15 +00:00
João Valverde f984def50c Add g_snprintf() to checkAPIs 2021-12-19 21:04:49 +00:00
João Valverde fe5248717f Replace g_snprintf() with snprintf()
Use macros from inttypes.h with format strings.
2021-12-19 20:06:13 +00:00
João Valverde f52611de89 Remove obsolete macro HFI_DECLS 2021-12-12 13:24:51 +00:00
João Valverde d2a9cb940a epan: Remove new proto tree API
Remove experimental new API.

Fix Netlink dissector to compile with normal proto tree API.

Closes #17774.
2021-12-10 14:37:01 +00:00
Tomasz Moń 7b82110092 USB HID: Parse bit fields with correct bit order
Implement little endian support for tvb_get_bits family of functions.
The big/little endian refers to bit numbering within an octet. In big
endian, the most significant bit is considered bit 0, while in little
endian the least significant bit is considered bit 0.

Add encoding parameters to proto tree bits format family functions.
Specify ENC_BIG_ENDIAN in all dissectors using these functions except in
USB HID that requires ENC_LITTLE_ENDIAN to work correctly.

When formatting bits values, always display most significant bit on the
leftmost position regardless of the encoding. This results in no gaps
between octets and makes the displayed value comprehensible.

Close #4478
Fix #17014
2021-09-26 18:16:28 +02:00
João Valverde 3fb7a6e0d5 checkAPIs: __func__ is now part of C99, allow it 2021-06-25 22:06:32 +00:00
Dario Lombardo f96886ebef
tools: add g_memdup to prohibited APIs. 2021-03-25 15:53:27 +01:00
João Valverde 7f105d3981 CMake: Use CheckAPI's abort/termoutput with dissectors only
I believe this was the original intention, to use these API restricitons
with dissectors only (not that I necessarily agree with that policy either),
and through copy-paste and lack of clear guidelines it spread to other
parts of the build.

Rename the checkAPI groups to make it very clear that this is dissector-only.

This doesn't mean, of course, that good programming practices shouldn't be
followed everywhere. In particular assertions need to be used properly.
Don't use them to catch runtime errors or validate input data.

This commit will be followed by another removing the various ugly hacks
people have been using to get around the checkAPI hammer.
2021-03-01 20:59:39 +00:00
Jann Horn 785ef0f43d checkAPIs: Fix typo
Fix the typo'd header name in the error message.
2020-11-19 18:16:37 +00:00
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