Commit Graph

466 Commits

Author SHA1 Message Date
Guy Harris cf5f0d3827 Fix the polynomial for the CCITT CRC.
And note that it's the same polynomial for the MPEG-2 CRC.

Change-Id: Ie89e392156ae77a2adeec3eb8e704aa75c0cd0dc
Reviewed-on: https://code.wireshark.org/review/3512
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-08 19:21:12 +00:00
Guy Harris 6f104a0ffb Clean up the CRC-10 code.
Have the wsutil routine just accumulate the stuff from the buffer handed
to us.  Have the IUUP dissector deal with the extra stuff.  Add a
update_crc10_by_bytes_tvb() routine, which is passed a tvbuff, offset,
and length, and use that rather than using tvb_get_ptr() in dissectors.

Change-Id: Iadd0823c764080e60d1339abb94d2e19150eabfe
Reviewed-on: https://code.wireshark.org/review/3509
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-08 18:09:02 +00:00
Guy Harris 9b9005eb94 The DRM DCP CRC-16 is the same as the X.25 CRC-16.
So just use crc16_x25_ccitt_tvb(), which goes a byte at a time rather
than a bit at a time, and which takes a tvbuff rather than requiring you
to call tvb_get_ptr().

It also doesn't 1's-complement the result, so we can compare it against the
0x1D0F in ETSI TS 102 821 V1.4.1 (2012-10) rather than against a
1's-complement version, 0xE2F0.

Change-Id: Ia513f851f0a8ff1e7853278ddf3618c532fb2aba
Reviewed-on: https://code.wireshark.org/review/3507
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-08 17:11:03 +00:00
Guy Harris 22ad90cdc8 Add routines for CRC-16 with a polynomial of 0x3D65.
There are routines that take a buffer and a length and that take a
tvbuff, offset, and length; use those routines in the DNP dissector
(which no longer needs its own table and loop), and use the tvbuff
routine instead of calling tvb_get_ptr().

Change-Id: Ic67b0f3b65b94ea47c0fdc2f3d3b6f88df77f9c6
Reviewed-on: https://code.wireshark.org/review/3505
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-08 15:58:06 +00:00
Guy Harris ad4d672976 Add a CRC32_ACCUMULATE() macro for a single CRC-32 step and use it.
Change-Id: I9462d45c5db6d54c0ee695046cb72be1acf379e8
Reviewed-on: https://code.wireshark.org/review/3497
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-08 08:06:11 +00:00
Guy Harris 74312299f2 Fix indentation.
Change-Id: I4342ec7723c43f8e12d6187609a1493a61725d31
Reviewed-on: https://code.wireshark.org/review/3492
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-08 07:19:36 +00:00
Guy Harris 0734ac385f Rename buffer_ routines to ws_buffer_ to avoid name collisions.
In particular, epan/wslua/lrexlib.c has its own buffer_ routines,
causing some linker warnings on some platforms, as reported in bug
10332.

(Not to be backported to 1.12, as that would change the API and ABI of
libwsutil and libwiretap.  We should also make the buffer_ routines in
epan/wslua/lrexlib.c static, which should also address this problem, but
the name change avoids other potential namespace collisions.)

Change-Id: I1d42c7d1778c7e4c019deb2608d476c52001ce28
Reviewed-on: https://code.wireshark.org/review/3351
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-02 11:01:29 +00:00
Jeff Morriss edb7a91105 Make the nameres test suite work out of tree by looking for the global hosts
file in the build directory (rather than the source directory).

Change-Id: I365e573ee84e9a41aa76f4aa9a4a6efaf42fb60e
Reviewed-on: https://code.wireshark.org/review/3334
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-02 01:00:08 +00:00
Evan Huus d610ef23a2 Add some #includes to satisfy check-abi
Change-Id: I705268d327b7dd96ed86bfdc8d7fe7d968e3e541
Reviewed-on: https://code.wireshark.org/review/3181
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-23 17:48:34 +00:00
Gerald Combs 59ef97dd65 [WIP] Add a conversation dialog.
Items are sorted by value.

Move common conversation code to ui/conversation_hash.[ch]. Add a
conversation_type_e enum along with convenience functions for fetching
titles, tap names, etc.

We have a single main dialog instead of a main dialog + individual
protocol dialogs. It de-clutters the statistics menu and results in
simpler code. Conversation type tabs can be added and removed within the
dialog itself. The tab list is sticky and saved with the current profile
when the dialog closes. Data can be copied as CSV or YAML.

Add a FilterAction class and a corresponding filterAction slot to
MainWindow. Use it for the Conversations context menu.

Add an addressResolutionChanged signal and related plumbing.

Get rid of the iterator members in the conversation item struct. Update
the GTK+ code accordingly.

Excercise for the reader:
- Update TShark to use the common hash code.

Ping-Bug: 9231
Ping-Bug: 8703
Ping-Bug: 6727
Change-Id: I8728d771fc5b1a85937bed9d898e53c3ecc3a544
Reviewed-on: https://code.wireshark.org/review/2987
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-21 23:19:09 +00:00
Guy Harris f724cae763 Only ABI-check strncasecmp.h if strncasecmp() is part of the API/ABI.
Some routines Wireshark uses are present in some, but not all,
platforms; for routines that would be used on all platforms, libwsutil
provides its own implementations on platforms that lack them.

On platforms that provide a routine, that routine will not be part of
the API and ABI, and, if we do an API or ABI check using the header
libwsutil provides to declare the function on platforms that lack it, we
may have a collision between the declaration in our header and the
declaration in a system header.

There's no guarantee that we can make them match, as the declaration
might differ from platform to platform and from platform version to
platform version, so we simply leave the header file out of the check if
we have the function on the platform on which we're checking the API or
ABI.

Change-Id: I8a23e63d9e17e5c1f5a83304dbe14d1e7df22e7e
Reviewed-on: https://code.wireshark.org/review/3115
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-19 07:24:01 +00:00
Guy Harris 644c1d5350 Add extern "C", to let this be used from C++.
Change-Id: I3c7d89b7aef301b49f3358ffb9b637acb00f720b
Reviewed-on: https://code.wireshark.org/review/3111
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-19 00:55:51 +00:00
Guy Harris d4dab16a3f Only one buffer.c, please.
Otherwise, if you link with both libwiretap and libfiletap, it's
anybody's guess which one you get.  That means you're wasting memory
with two copies of its routines if they're identical, and means
surprising behavior if they're not (which showed up when I was debugging
a double-free crash - fixing libwiretap's buffer_free() didn't fix the
problem, because Wireshark happened to be calling libfiletap' unfixed
buffer_free()).

There's nothing *tap-specific about Buffers, anyway, so it really
belongs in wsutil.

Change-Id: I91537e46917e91277981f8f3365a2c0873152870
Reviewed-on: https://code.wireshark.org/review/3066
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-15 23:43:32 +00:00
Graham Bloice 9ba0a18d12 Fix up library names when using CMake on Windows
Change-Id: I3573e69eb54044bb915161756dbb8f18cc769061
Reviewed-on: https://code.wireshark.org/review/2957
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-07-15 20:37:44 +00:00
Bill Meier 14f943403a Remove $Id$
Change-Id: Iae71c6e65000471f251717a172c5f4b812ac1bd3
Reviewed-on: https://code.wireshark.org/review/3011
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-11 20:04:15 +00:00
Pascal Quantin e1bad3cd9b Remove a useless line now that nghttp2 library has moved to /epan
Change-Id: I41c876620e691f2e217fc9249d6abae01ea81b7f
Reviewed-on: https://code.wireshark.org/review/2975
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-07-10 07:31:03 +00:00
Guy Harris 9b182b7097 Revert "See if we can get rid of the "lib" in front of "wsutil" on Windows."
This reverts commit c5a50df51f.

Most of the change to remove "lib" seems to work, but the list of libraries to sign appears not to be in the source repository, so I can't make that step work.

Change-Id: I6ead152fc308480d02266b0f3f0caaa873caf6d2
Reviewed-on: https://code.wireshark.org/review/2973
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-10 00:59:31 +00:00
Guy Harris c5a50df51f See if we can get rid of the "lib" in front of "wsutil" on Windows.
"libXXX" is a UN*X convention; see whether we can do without it on
Windows.

Change-Id: I03a377ed5121a8dff7a53203b34e441abffcbb85
Reviewed-on: https://code.wireshark.org/review/2968
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-09 23:23:47 +00:00
Graham Bloice 4b5967f683 Moved nghttp2 to epan
Cleaned up nghttp2 build

Change-Id: I9f7adc12936155e0ffc01ec825b5aff95279f97d
Reviewed-on: https://code.wireshark.org/review/2937
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-09 05:31:31 +00:00
Peter Wu f2b4daf400 Add printf-format annotations, fix garbage
The WRETH dissector showed up some garbage in the column display. Upon
further inspection, it turns out that the format string had a trailing
percent sign which caused (unsigned)-1 to be returned by
g_printf_string_upper_bound (in emem_strdup_vprintf). Then ep_alloc is
called with (unsigned)-1 + 1 = 0 memory, no wonder that garbage shows
up. ASAN could not even catch this error because EP is in charge of
this.

So, start adding G_GNUC_PRINTF annotations in each header that uses
the "fmt" or "format" paramters (grepped + awk). This revealed some
other errors. The NCP2222 dissector was missing a format string (not
a security vuln though).

Many dissectors used val_to_str with a constant (but empty) string,
these have been replaced by val_to_str_const. ASN.1 dissectors
were regenerated for this.

Minor: the mate plugin used "%X" instead of "%p" for a pointer type.

The ncp2222 dissector and wimax plugin gained modelines.

Change-Id: I7f3f6a3136116f9b251719830a39a7b21646f622
Reviewed-on: https://code.wireshark.org/review/2881
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-06 23:00:40 +00:00
Peter Wu ec6a22dc3b Workaround for ASAN failure in _ws_mempbrk_sse42
When ASAN is enabled, a false buffer overflow warning is raised. It is
a false positive since everything starting at '\0' will get ignored by
the PCMPISTRI instruction (see Intel(r) SSE4 Programming Reference,
5.3.1.5 "Valid/Invalid Override of Comparisons", and 5.3.1.2
"Aggregrate Operation", case "Equal any").

Concerns about reading past the end of the page turns out to be false,
there always seem to be a valid page after the current one (for static
and heap memory at least). It is an non-issue since strlen also does
not have issues with this.

Rather than fully disabling SSE 4.2 and using the fallback
implementation for ASAN-enabled builds, read the set of characters from
'a' into the mask without a 128-bit read and then still use SSE 4.2
for the actual query.

Bug: 10214
Change-Id: Ie4a526e60b43bfc08dd1d821556766f14a49be4d
Reviewed-on: https://code.wireshark.org/review/2618
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-06 22:53:34 +00:00
Guy Harris 5bfc21cf9e Clean up handling of missing functions.
With autotools, CMake, and nmake, if we have a function, #define
HAVE_{function_name_in_all_caps}, otherwise don't #define it.

If we provide our own version of a function in libwsutil, make sure we
have a header that declares it, and *ONLY* include that header if
HAVE_{function_name_in_all_caps} is *NOT* defined, so that we don't have
the system declaration and our declaration colliding.

Check for inet_aton, strncasecmp, and strptime with CMake, just as we do
with autotools.

Simplify the addition of {function_name_in_all_caps}_LO to libwsutil in
autotools.

Change-Id: Id5be5c73f79f81919a3a865324e400eca7b88889
Reviewed-on: https://code.wireshark.org/review/2903
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 21:03:09 +00:00
Guy Harris 2a740bd4d5 Squash casting-away-constness warnings.
BYTE2WORD() doesn't modify what its argument points to, so make that
argument a const unsigned char *.

This lets us get rid of casts that cast away constness.

Change-Id: I44a58bd3d75fc77a022b7e8f7fa9b43990bcf81c
Reviewed-on: https://code.wireshark.org/review/2876
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 11:15:18 +00:00
Guy Harris c654add76c Add consts to casts to suppress warnings.
Pull the "cast this to a pointer to an __m128i" idiom into a macro, and
use the macro; have that macro use "const" in the casts.

Change-Id: Ife90b7daef2f09368790f3b2ffbb227d6d794dea
Reviewed-on: https://code.wireshark.org/review/2871
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 01:30:18 +00:00
Alexis La Goutte 3686713e7c Update libnghttp2 to latest master (add support for draft-13)
Bug:10256
Change-Id: I24275f1b67120f69cfd673f7e5598a50b3c7566f
Reviewed-on: https://code.wireshark.org/review/2145
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-07-05 07:11:21 +00:00
Guy Harris 06bd8045d7 Make wsutil depend on gitversion.
wsutil contains the only code that uses version.h; make the dependency
explicit, to see whether that fixes the current build issues with Debian
packaging.

Also, get rid of all *other* dependencies on gitversion.

Change-Id: I89fa5e4112633b83a1a7dfa349bc337e3688575f
Reviewed-on: https://code.wireshark.org/review/2823
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03 17:16:54 +00:00
Guy Harris f3c62edc77 Move the GLib version info string stuff to get_glib_version_info().
Change-Id: I1013ad9a0a98bcbf07fe597f9e932f2ea1a5cd28
Reviewed-on: https://code.wireshark.org/review/2818
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03 15:10:25 +00:00
Guy Harris 0e4e825309 Add license information to the copyright information.
See

	http://www.gnu.org/prep/standards/html_node/_002d_002dversion.html

Change-Id: I19c1cf560a1bb7ed7d7312bea727550977d66120
Reviewed-on: https://code.wireshark.org/review/2787
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03 01:33:51 +00:00
Guy Harris ac88f71220 Clean up a comment.
SetProcessDEPPolicy() is the API; PSetProcessDEPPolicy is just a local
pointer variable that either points to that API's implementation (if
it's available) or is null (if it isn't).

Change-Id: I676fbb75019e32af511cefa6f1c7b7124ac9d8e8
Reviewed-on: https://code.wireshark.org/review/2735
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-30 23:03:22 +00:00
Pascal Quantin e2801d0da0 Windows: fix update of version information in wireshark and tshark
Broken since gc46329c

Change-Id: I00146675d16db021e2cbb7b16841ea9ecb1439b9
Reviewed-on: https://code.wireshark.org/review/2703
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-30 05:13:24 +00:00
Guy Harris fe42762f23 Move some more stuff into wsutil.
Move the routines to parse numerical command-line arguments there.

Make cmdarg_err() and cmdarg_err_cont() routines in wsutil that just
call routines specified by a call to cmdarg_err_init(), and have
programs supply the appropriate routines to it.

Change-Id: Ic24fc758c0e647f4ff49eb91673529bcb9587b01
Reviewed-on: https://code.wireshark.org/review/2704
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-29 23:03:24 +00:00
Alexis La Goutte b632c23a3b Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I5c66a456b7986e3fd7672deaf7ce773467873324
Reviewed-on: https://code.wireshark.org/review/2653
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-06-26 02:41:48 +00:00
Guy Harris dbd409d041 Fix OS X CMake build.
I have ***NO*** idea why this makes a difference, but, without this
change, APPLE_CORE_FOUNDATION_LIBRARY is apparently *not* set correctly
for wsutil/CMakeLists.txt, and, with this change, it is.  I guess
there's something magic involved here with "global" CMake variables or
something crazy such as that.

Change-Id: I7a0046b9c249568cd666720838104f48e854e203
Reviewed-on: https://code.wireshark.org/review/2612
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-24 07:10:12 +00:00
Guy Harris 7ba4aef599 Don't declare CFString_to_C_string() if we don't have OS X frameworks.
You shouldn't be including cfutils.h if you don't have CF, but this may
be tripping up the ABI checker.

Change-Id: Ib736a33013c6ab0f416ebbedaa4ebf112bade6f7
Reviewed-on: https://code.wireshark.org/review/2530
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-22 01:11:29 +00:00
Guy Harris c46329c27b Add a routine to return a version string including VCS information.
Add a routine get_ws_vcs_version_info() that, for builds from a tree
checked out from Wireshark's version control system, returns a string
that includes both the Wireshark version number and an indication of
what particular VCS version was checked out, and just returns
Wireshark's version number for other builds.

Use that routine rather than manually gluing VERSION and the Git version
number together.

("vcs", not "git", just in case we do something bizarre or mercurial
some day. :-))

Change-Id: Ie5c6dc83b9d3f56655eaef30fec3ec9916b6320d
Reviewed-on: https://code.wireshark.org/review/2529
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-22 01:06:25 +00:00
Guy Harris a70dea1956 Move get_os_major_version() to wsutil and rename it to get_windows_major_version().
It's Windows-specific, so name it appropriately.

Change-Id: Ic518cbfabebf95757f6b308a4d547a6cabed6a5e
Reviewed-on: https://code.wireshark.org/review/2528
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 21:33:11 +00:00
Guy Harris 73c7addfa6 Move the routine to get memory information to wsutil.
Change-Id: I94717cec5a464166585b258a83f8ccdaccf8d5ff
Reviewed-on: https://code.wireshark.org/review/2525
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 20:31:53 +00:00
Guy Harris 3c96970544 Get rid of trailing blank lines.
Change-Id: Ie28a9904fd8befe98677c9f9f169beffe4df1d5d
Reviewed-on: https://code.wireshark.org/review/2524
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 20:22:13 +00:00
Guy Harris 00f23a4f5c Move the routine to get a CPU information string to wsutil.
Change-Id: Ibf6e57d7382cbbd831a0367fd48d684118712408
Reviewed-on: https://code.wireshark.org/review/2523
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 20:21:03 +00:00
Guy Harris 9e8fb87a3e Clean up inclusion of cfutils.h.
Change-Id: I7da381f12db6721448e15d30d441a943127cbca1
Reviewed-on: https://code.wireshark.org/review/2522
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 19:54:40 +00:00
Guy Harris 83d832c8ee Get rid of trailing blank lines.
Change-Id: Ib806d07aea8e4d903f084171ce2021c6f3c3fc07
Reviewed-on: https://code.wireshark.org/review/2520
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 19:37:34 +00:00
Guy Harris d99d1b90f8 Add a get_compiler_info() routine in libwsutil to get compiler information.
Change-Id: I8ccb6187f2ee0255460f448aee170768b6fa3f5d
Reviewed-on: https://code.wireshark.org/review/2519
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 19:35:06 +00:00
Guy Harris f13f70d1c4 Need <string.h> for string routines.
Change-Id: I828bb29953727eb43e169fa9b06837c9657ca051
Reviewed-on: https://code.wireshark.org/review/2517
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 19:07:15 +00:00
Guy Harris aeed656ceb We need the Unicode utilities, at least on Windows.
Multiple UTFs FTW!

Change-Id: Ib50dda4577f0038b11179be92dc6fb321b033618
Reviewed-on: https://code.wireshark.org/review/2516
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 19:02:45 +00:00
Guy Harris d0a567e94b We need <windows.h> on Windows.
Change-Id: I54c9991b3322d14966913367f951900cc7e54c4e
Reviewed-on: https://code.wireshark.org/review/2513
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 18:34:36 +00:00
Guy Harris a1112249fa Move get_os_version_info() to libwsutil.
This mean we also have to move CFString_to_C_string() there for OS X.

Change-Id: Ic91ad872e9d5290cf34f842503ededd5452e4337
Reviewed-on: https://code.wireshark.org/review/2511
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 18:02:32 +00:00
Guy Harris 43443af0ac Move get_copyright_info() to wsutil.
Change-Id: I75c1c747cd2b4a9845c659636582d54b2caecf1a
Reviewed-on: https://code.wireshark.org/review/2510
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-21 17:33:05 +00:00
Joerg Mayer c11ae8ac82 Add .rc files to the sources to have them included in the build
Change-Id: I84dda519e617b24d92fcf374670a4a6ee6f488ee
Reviewed-on: https://code.wireshark.org/review/2506
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-20 23:58:22 +00:00
Evan Huus 0c3e1a243b Add casting and license info to fix buildbots
Change-Id: Iea53b17480d758c16822d80778fa4f186a188a91
Reviewed-on: https://code.wireshark.org/review/2470
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-19 23:55:47 +00:00
Michael Mann 53594f34e4 Dissectors for totemnet and totemsrp protocols implemented in corosync cluster engine. Bug 3232.
From Masatake YAMATO

changes in patch3 (Masatake YAMATO):

  * Fix a typo(s/Sequnce/Sequence/)
  * Use variable len instead of a number literal
  * Put _U_ marker to length parameter of dissect_corosync_totemsrp_ip_address
  * Use tvb_report_length instread of tvb_length

changes in patch5 (Masatake YAMATO):

  * packet-corosync-totemsrp.c: Adapt to new dissector_try_heuristic interface

    + pass hdtbl_entry argument to dissector_try_heuristic.

  * packet-corosync-totemnet.c: Initialize corosync_totemnet_port to 5405

changes in patch6 (Masatake YAMATO):

  * packet-corosync-totemsrp.c: Use tvb_reported_length instead of tvb_length.
  * packet-corosync-totemsrp.c: Remove unnecessary trailing space in string literals.

  * packet-corosync-totemnet.c: Remove SVN Id tag in a comment.

changes in patch8 (Masatake YAMATO):

  * packet-corosync-totemnet.c: Remove SVN Id tag in comment(again).
  * packet-corosync-totemsrp.c: Use val_to_str_const instead of val_to_str.

changes in patch9 (Masatake YAMATO):

  * wsutil/sober128.[ch]: New files derived from packet-corosync-totemnet.c.
    Decryption code is moved here.
  * packet-corosync-totemnet.c: Remove all decryption code from this file.

Change-Id: Id832d9c5ce1be1668c857c9bbf39e8a84c31880c
Reviewed-on: https://code.wireshark.org/review/725
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-19 18:23:09 +00:00
Guy Harris 421d817d70 Don't compile anything with -msse4.2 unless the compiler supports it.
This includes ws_mempbrk_sse42.c; if the compiler doesn't support
-msse4.2, HAS_SSE4_2 isn't defined, so all the stuff in
ws_mempbrk_sse42.c that uses SSE 4.2 will be #ifdeffed out.

Not all compilers with which we're built will support -msse4.2; in
particular, the ones that aren't compiling for x86 won't....

Change-Id: I69566ca06f602104b40c78b3b06fcb7dfeb054b2
Reviewed-on: https://code.wireshark.org/review/2373
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-18 09:50:43 +00:00
Jakub Zawadzki 6664030571 Rewrite check for ws_mempbrk_sse42.c compilation
- check only for -msse4.2
- check if there's nmmintrin.h header
- don't check if current CPU support -msse4.2 (fix cross compilation)

Change-Id: Iba8d291fdf5602937ab540a69b7608a81427ad25
Reviewed-on: https://code.wireshark.org/review/2189
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-17 23:58:52 +00:00
Jeff Morriss f113306e0e More Python-bindings removal.
Change-Id: I4d82175781e65c73179f4c8e737a7900cb050bce
Reviewed-on: https://code.wireshark.org/review/2283
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-06-16 23:14:05 +00:00
AndersBroman f5476e90a0 Explicitly declare/cast 'unsigned <variable>' as 'unsigned int <variable>'
Applying part of Bug 7825

Change-Id: I460b5c61b04d793ccc27c25debbd5e8f08bc6974
Reviewed-on: https://code.wireshark.org/review/2280
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-16 22:03:12 +00:00
Joerg Mayer 935280317a Backport autofoo simd optimization
Change-Id: I5d58154bf8266eabedf550b54f18845612f514c6
Reviewed-on: https://code.wireshark.org/review/2206
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-14 06:44:15 +00:00
Joerg Mayer a4a7d2cfec Small whitespace fixes
Change-Id: I44c6c193ec2a7d88cda56ba34c2f17c03f7e121d
Reviewed-on: https://code.wireshark.org/review/2205
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-14 06:43:22 +00:00
AndersBroman fcb019acb8 Change HAVE_SSE42 to HAVE_SSE4_2 add $(SIMD_FLAGS)
Add autotools macros to distribution
Call AX_EXT to define HAVE_SSE4_2

Change-Id: I9ff085d923dfafb32510cdd14290e74a2aaea302
Reviewed-on: https://code.wireshark.org/review/2110
Tested-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-10 14:51:26 +00:00
Alexis La Goutte 5d7b59aec4 Fix Buildbot Mac OS: /wsutil/ws_cpuid.h:56: warning: unused parameter 'CPUInfo'
Change-Id: Ic0b0d5392ff049cc51f05b79fc5feae190064ce8
Reviewed-on: https://code.wireshark.org/review/2097
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-10 09:00:41 +00:00
AndersBroman e1f0ee412f Mark an unused parameter as such.
Change-Id: Ia319d7b8523ab9b9e9d8ec8533ebdcf4a506a69e
Reviewed-on: https://code.wireshark.org/review/2096
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-10 08:58:42 +00:00
Alexis La Goutte d041b1e91b WS mempbrk SEE4.2: Fix indent (use 2spaces) and add Modelines info
Change-Id: I50c71401f46846a459b18347ef0b9793a2a05ea7
Reviewed-on: https://code.wireshark.org/review/2084
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-10 08:13:54 +00:00
Jakub Zawadzki 4571283379 CPUID improvements
- Make ws_cpuid() return boolean when CPUID is support or no, this way
it's easier for caller to determinate if it works (and can use cpuinfo[X] or no).

- Add function ws_cpuid_sse42(), use it in ws_mempbrk() [cached] &
  version information.

Change-Id: I4e77699f9f3d11bb9b2e8ea599e48d3c5ad84ed7
Reviewed-on: https://code.wireshark.org/review/2088
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-10 08:12:43 +00:00
Tomasz Moń 9538d1c433 Fix CMake build.
Change-Id: I749c6f1e978e385a9f1340f315c670404a2470ad
Reviewed-on: https://code.wireshark.org/review/2087
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-06-09 22:00:21 +00:00
AndersBroman c9621e2bef We must include config.h to have HAVE_SSE42
Change-Id: I2b882b05b2864edbfef0ea03bc086efeaac84ad2
Reviewed-on: https://code.wireshark.org/review/2086
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09 19:30:17 +00:00
AndersBroman 618187a777 Hopfully thiw will make the Solaris build going.
Change-Id: I44b93494f6d3cb0504517ab4581afeef180f1513
Reviewed-on: https://code.wireshark.org/review/2079
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09 16:36:29 +00:00
AndersBroman c2a187f4ac Try to fix OSX build
Change-Id: Iab664f349e7604b99368f4a986dfe98db48aea84
Reviewed-on: https://code.wireshark.org/review/2078
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09 16:24:50 +00:00
AndersBroman f9254e5173 Fix a copy paste error.
Change-Id: I9a153b3e89886c7de943226dd5313c90e8be1b7b
Reviewed-on: https://code.wireshark.org/review/2075
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09 16:00:13 +00:00
AndersBroman 8e8a4ceba3 Try to fix the builds.
Change-Id: I3ccb5c1b40504cd9314da5a09b225e3e2bf991b8
Reviewed-on: https://code.wireshark.org/review/2073
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09 15:31:45 +00:00
Alexis La Goutte d3104c228e Make buildbot Happy about shadow index variable...
Change-Id: I4c93af520883235828a4bb1881c74035eace995d
Reviewed-on: https://code.wireshark.org/review/2070
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-09 13:33:33 +00:00
Jakub Zawadzki fcb710baec Add sse4.2 optimized function ws_mempbrk_sse42()
In text protocols, like SIP, lot of time is spend guint8_pbrk(),
assume that text is not binary (no NULs), and use SSE4.2 pcmpistri
instruction.

Also move & rename guint8_pbrk() from tvbuff.c as _ws_mempbrk.

HAVE_SSE42 must be defined to use _ws_mempbrk_sse42() only activaded for
Windows currently.

Change-Id: Ic853d84805bdb6492c4f45d2bcc79a973fd9804e
Reviewed-on: https://code.wireshark.org/review/1730
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09 12:02:27 +00:00
Guy Harris 090f568e6a Make this comple whether assertions are enabled or not.
Make the check for a valid index range a macro, so the compiler doesn't
whine if it's not used, but it's available if it *is* used.

Change-Id: I3cee0460eacef23187c141458dc5ac7a7acbf7c8
Reviewed-on: https://code.wireshark.org/review/1914
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-01 21:55:37 +00:00
Joerg Mayer 6f15d7a865 Fix /home/jmayer/work/wireshark/git/wsutil/nghttp2/nghttp2_hd.c:996:12: error: ‘check_index_range’ defined but not used [-Werror=unused-function]
static int check_index_range(nghttp2_hd_context *context, size_t idx)
            ^
cc1: all warnings being treated as errors

Change-Id: Ie8e3fe12d339a689e0222eda501b253a7d6d923c
Reviewed-on: https://code.wireshark.org/review/1912
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-01 19:58:13 +00:00
Pascal Quantin 09816dd4c5 nghttp2: do not copy nghttp2* objects in wsutil folder
Change-Id: I114d3a795a93c7612453fcd08f6e30e520dde900
Reviewed-on: https://code.wireshark.org/review/1902
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-31 15:49:05 +00:00
Pascal Quantin 158dd9c10d nghttp2: more warning fixes
Change-Id: Ib94a02f5977bd7d456895bbe453c35d77f559bd1
Reviewed-on: https://code.wireshark.org/review/1901
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-31 15:35:51 +00:00
Pascal Quantin 173e3024ed nghttp2: upgrade library to g4f7223e and add casts to please buildbots
Change-Id: Ic412d4bfc56695cbcab709d42a6f31aa9e50c64e
Reviewed-on: https://code.wireshark.org/review/1900
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-31 15:01:44 +00:00
Alexis La Goutte 33fc5c0300 NGHTTP2: Add missing nghttp2_int.h (need by make dist...)
Change-Id: I7906f28b42960ea69b7f23e888bc0e184f67021a
Reviewed-on: https://code.wireshark.org/review/1899
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-31 14:53:57 +00:00
Alexis La Goutte 41c78afc54 NGHTTP2: fix -Wshadow about index with some old GCC release or Mac OS X buildbot
(No problem with gcc-4.7 or gcc-4.8)

Change-Id: Iae1f801abeb80429c08e93668133a9c5ac7977ef
Reviewed-on: https://code.wireshark.org/review/1898
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-31 14:20:24 +00:00
Alexis La Goutte c4aa524291 NGHTTP2: fix typo (nghttp2_ent.h => nghttp2_net.h)
Change-Id: I52d3c40794841614d55e88c9fe9cf2de43a0fa46
Reviewed-on: https://code.wireshark.org/review/1897
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-31 14:15:40 +00:00
Alexis La Goutte 62fd14cbd7 Add nghttp2 lib (HPACK)
Change-Id: I2a361951924045035a2a5d38f943e6b97c170f36
Reviewed-on: https://code.wireshark.org/review/1623
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-31 13:11:05 +00:00
Jakub Zawadzki 531541660b Move cpuid to seperate header file.
It'll be later used also for detecting sse4.2

Change-Id: I1930abb29026b455d453a79b5f301cdf37585160
Reviewed-on: https://code.wireshark.org/review/1803
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-31 13:01:08 +00:00
Balint Reczey 5c6403b27b Honor configured CMAKE_INSTALL_LIBDIR when installing libraries
Change-Id: I860c9408ed01e9567992b0dcf5c6c6421344c13e
Reviewed-on: https://code.wireshark.org/review/1862
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-30 13:36:02 +00:00
Balint Reczey 7bf49b31ac Set PLUGIN_INSTALL_DIR properly for wireshark.pc
Change-Id: I64c04095ce780ce2cc44a54a68695506d27e5747
Reviewed-on: https://code.wireshark.org/review/1861
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-30 12:48:08 +00:00
Alexis La Goutte 56d8ff6790 Add Modelines
Change-Id: I3b41a15f53afc718ccf5892174345220a09c6714
Reviewed-on: https://code.wireshark.org/review/1847
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-28 23:41:42 +00:00
Alexis La Goutte eb1bbb677d Fix indent (use tabs)
Change-Id: Iecb242bddb06779ba8b5ce8913fa9c4f64d7f79a
Reviewed-on: https://code.wireshark.org/review/1812
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-27 23:58:08 +00:00
Guy Harris f67fc8a4d2 Fix some whitespace issues.
Change-Id: I363361e898c4b37fcde29847a1473530e5052733
Reviewed-on: https://code.wireshark.org/review/1771
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 23:44:57 +00:00
Guy Harris d470a468a6 More handling of missing time stamps.
Make nstime_cmp() handle "unset" time stamps (they're equal to other
"unset" time stamps, and less than all other time stamps), use it in
reordercap, and "unset" the time stamp if it's absent.

Also, nstime_cmp() does not modify its argument, so make it const.

Change-Id: I016dab5fefaf4696e78cbd8c6dd3395808e54369
Reviewed-on: https://code.wireshark.org/review/1769
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23 23:41:21 +00:00
AndersBroman 3157bf6ba5 isprint() -> g_ascii_isprint()
Change-Id: Ia586ef8ce500d5fc7578c52014206fa7a7eaea41
Reviewed-on: https://code.wireshark.org/review/1624
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 16:14:07 +00:00
AndersBroman f7819de76a In ascii_xx_inplace use g_ascii_isupper/g_ascii_islower directly, it
*should* be slightly more efficient.

Change-Id: I3081e2e25f241cdb07fa46011f50709fd560fb1c
Reviewed-on: https://code.wireshark.org/review/1626
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-13 16:07:08 +00:00
Stig Bjørlykke bd38b3152d Support out-of-source checkapi
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-25 04:23:46 +00:00
Jakub Zawadzki 75cb2675fd Move mktime_utc() from tvbuff.c to wsutil/time_util.c
Also do little cleanup in mktime_utc (one big #ifndef)

Change-Id: I8f721ba76cad856cfef0a2d78e7f98686f8e4e3f
Reviewed-on: https://code.wireshark.org/review/1327
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-25 04:13:02 +00:00
Stig Bjørlykke a317ba0e1f Fixed typo HAVE_LIBGRYPT -> HAVE_LIBGCRYPT
Change-Id: I85772e1f4d4882810bf82a9903e30156eb374df9
Reviewed-on: https://code.wireshark.org/review/1191
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-04-17 22:01:22 +00:00
Hadriel Kaplan dd002649c3 Add tvb_get and proto_tree_add for string-encoded timestamps
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-14 11:47:39 +00:00
Gerald Combs 63ed4745a2 Replace QTableWidgets with QLabels + HTML tables.
This lets the user select and copy the folder and plugin data as text.
Add clickable local filesystem URLs while we're at it.

(I suspect that you shouldn't use QTableWidgets unless you're creating a
spreadsheet.)

Change-Id: I45650bd4f4b6215824a4ed70ec80698d0805baba
Reviewed-on: https://code.wireshark.org/review/1064
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-04-13 18:32:55 +00:00
Bill Meier c0b0a11e4e (Pedantic): set editor modelines tab-width & etc to 8; Also: fix some indentation in packet-sip.c
Change-Id: I623fc5e4c1247dbe5e15f0f33270f4f0994268ab
Reviewed-on: https://code.wireshark.org/review/943
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-04-03 15:31:56 +00:00
Alexis La Goutte 7d77d753c6 Continue to remove $Id$ from top of file
(Using sed :sed -i '/^\/\* \$Id\$ \*\//,+0 d') ( /* $Id */ )

Change-Id: I46e928d7f2a307c35876ed5d34cb6b7cccfcd6e9
Reviewed-on: https://code.wireshark.org/review/886
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 18:49:26 +00:00
Alexis La Goutte 757aa33220 Continue to remove $Id$ from top of file
(Using sed : sed -i '/^\# \$Id\$/,+1 d') (start with dash)

Change-Id: Ia4b5a6c2302f6a531f6a86c1ec3a2f8205c8c2dd
Reviewed-on: https://code.wireshark.org/review/881
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 18:48:06 +00:00
Alexis La Goutte b0ba475fbf Continue to remove $Id$ from top of file
(Using sed : sed -i '/^  \$Id\$/,+1 d') (No star only 2 spaces before)

Change-Id: Id7b254031769a9dca2941304e4d3a0f4bdbc3f54
Reviewed-on: https://code.wireshark.org/review/883
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 18:46:57 +00:00
Alexis La Goutte 09cd306d1c Continue to remove $Id$ from top of file
(Using sed : sed -i '/^\* \$Id\$/,+1 d') (no space before star)

Change-Id: I318968db2b8512ba1303b5fc5c624c66441658f0
Reviewed-on: https://code.wireshark.org/review/879
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 18:30:52 +00:00
Alexis La Goutte 3170f2e418 Continue to remove $Id$ from top of file
(Using sed : sed -i '/^ \*  \$Id\$/,+1 d') (Double space between star and $Id$)

Change-Id: If9b8f345e3b6493de0b573600e60005c8b0b33c3
Reviewed-on: https://code.wireshark.org/review/877
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-31 15:59:51 +00:00
Alexis La Goutte 0f51f78608 The 1.11.x installer puts the global plugins in the wrong place [Mac OS X]
Issue found by rols

Fix comment and use the correct plugin_dir path (missing wireshark folder)

Change-Id: I298bc5e9872d8c20c5baeaaf056262b9668f15bf
Closed-bug: 9854
Reviewed-on: https://code.wireshark.org/review/745
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-19 18:42:31 +00:00
Alexis La Goutte eb2fb39ff7 The 1.11.x installer puts the global plugins in the wrong place [Mac OS X]
Issue found by rols

The installer puts the normal included plugins (e.g. mate, wimax) in
/Applications/Wireshark.app/Contents/Frameworks/wireshark/plugins,
however the global plugins directory is set to
/Applications/Wireshark.app/Contents/Resources/lib/wireshark/plugins
(as it was in previous versions) so no plugins load at startup.
In order to make them load you have to create this directory and
copy the plugins there, or put them in your personal directory.

From remark of Gerald, use recommandation of Bundle Programming Guide (use Contents/PlugIns for plugin)

https://developer.apple.com/library/mac/documentation/corefoundation/conceptual/cfbundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW19

Change-Id: Ib1ae7da48a8fa94f7037912cd44c05532a238b71
Closed-bug: 9854
Reviewed-on: https://code.wireshark.org/review/602
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-19 11:19:37 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Guy Harris 9733917e28 Sherman, set the Wayback Machine for 1997.
The URLs for the CRC-10 code are dead; use Wayback Machine URLs.

Change-Id: I3924e9cabb3b49b0e1abb31fbffa9b89f95cd0ce
Reviewed-on: https://code.wireshark.org/review/419
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-02-27 00:59:23 +00:00
Bill Meier 11b5c15fdb Remove trailing whitespace
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0
Reviewed-on: https://code.wireshark.org/review/385
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 20:46:49 +00:00
Hadriel Kaplan 0353c9a8e3 Fix Bug 6489 to stop compiler warning on gcrypt deprecated delcarations
The libgcrypt library has several deprecated functions exported, that we don't use.
Unfortunately the GCC compiler warns about these deprecated functions regardless,
which is quite annoying.  This commit makes clang/gcc ignore the deprecated attribute,
for gcrypt.h only.  The danger with this is if gcrypt ever deprecates a function
we actually *use*, then we won't see the warning.  So I'm not sure if it's a good or
bad idea to do this change, but it's really annoying to see the warnings and makes
finding real warnings difficult.

Change-Id: I03e80a6e7e4833ce0f709088c9ab4af98193db3d
Reviewed-on: https://code.wireshark.org/review/128
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-02-09 13:18:40 +00:00
Guy Harris 570a36436c Consistently use "guint8" for "8-bit byte".
Constify.

For routines that manipulate sequences of 8-bit bytes, have them take
guint8 pointers rather than void pointers.

Don't cast away constness.

svn path=/trunk/; revision=54795
2014-01-14 18:03:54 +00:00
Anders Broman 05f7044bc7 Make internal functions static
svn path=/trunk/; revision=54686
2014-01-10 07:01:15 +00:00
Guy Harris 2adcfcd914 Need <strsafe.h> for StringCchPrintf().
svn path=/trunk/; revision=54644
2014-01-08 00:39:14 +00:00
Jakub Zawadzki d28084d183 Move UAT xton() to wsutil library
Use ws_xton() in few more places.

svn path=/trunk/; revision=54642
2014-01-08 00:28:13 +00:00
Guy Harris e8dd800cc1 As checkAPIs.pl says, "use StringCchPrintf".
svn path=/trunk/; revision=54641
2014-01-07 23:56:21 +00:00
Jakub Zawadzki abda30e9e6 Fix bug #9618: Invalid utf8 causes JSON dissector assertion failure "g_utf8_validate"
Validate JSON UTF-8 characters, replace with '?' when invalid.

svn path=/trunk/; revision=54633
2014-01-07 22:17:32 +00:00
Jakub Zawadzki d1dcee936b Move defines for helping with UTF-16 surrogate pairs to wsutil/unicode-utils.h
tvbuff version was moved, but with 'or' optimization from packet-json.

svn path=/trunk/; revision=54632
2014-01-07 21:55:49 +00:00
Jakub Zawadzki ca91b33cc8 There's no need to mark inline functions with _U_
svn path=/trunk/; revision=54459
2013-12-26 10:53:53 +00:00
Jakub Zawadzki be733f3041 Move epan/base64.[ch] to wsutil/ with function name change.
svn path=/trunk/; revision=54326
2013-12-21 14:38:51 +00:00
Bill Meier 7838eada54 - Change guint32 array initializer constants to use 'U' rather than 'L'
(not that it actally makes any difference);
- Change 'guint crc32_0AA725CF_reverse[]' to 'guint32 ...'
 (no actual difference);
- Fix some indentation;
- Add editor modelines.

svn path=/trunk/; revision=54309
2013-12-20 16:57:02 +00:00
Gerald Combs 82d0e1f669 Another try at marking the ws_sign_ext functions possibly-unused.
svn path=/trunk/; revision=54267
2013-12-19 20:16:31 +00:00
Gerald Combs 67ceb469b3 Try to fix a warning found by, but not related to, the ABI check.
svn path=/trunk/; revision=54265
2013-12-19 19:12:25 +00:00
Jakub Zawadzki ff2a5847b9 sign_ext.h: use G_GINT64_CONSTANT(), add sample for alternative method of sign extension.
Alternative method looks much nicer in dissasembly.

svn path=/trunk/; revision=54202
2013-12-17 22:16:06 +00:00
Jakub Zawadzki c8716a45ee Put sign_ext.h in Makefile.
svn path=/trunk/; revision=54198
2013-12-17 21:38:59 +00:00
Jakub Zawadzki 0de43ce2dd Create sign extension routines in <wsutil/sign_ext.h>, use it in few places.
svn path=/trunk/; revision=54197
2013-12-17 21:36:33 +00:00
Alexis La Goutte 67c04188ce Fix (-W)documentation error found by Clang
error: parameter '...' not found in the function declaration [-Werror,-Wdocumentation]

svn path=/trunk/; revision=53719
2013-12-02 13:45:59 +00:00
Guy Harris 0cc1545d05 Move most of the plugin code from epan to wsutil and remove all
knowledge of particular types of plugins.  Instead, let particular types
of plugins register with the common plugin code, giving a name and a
routine to recognize that type of plugin.

In particular applications, only process the relevant plugin types.

Add a Makefile.common to the codecs directory.

svn path=/trunk/; revision=53710
2013-12-02 08:30:29 +00:00
Jakub Zawadzki d99fdfda63 Replace macros: BSWAP16, BSWAP32, BSWAP64 with glib-version.
XXX, people are not aware that expression of this macros might be evaluated multiple times, like:
 -  BSWAP16(tvb_get_letohs(tvb, off)) : \
 +  GUINT16_SWAP_LE_BE(tvb_get_letohs(tvb, off)) : \

Should be tvb_get_ntohs() called?


svn path=/trunk/; revision=53653
2013-11-29 19:21:20 +00:00
Jakub Zawadzki 5ac6474c94 Rename some of pint.h macros to match common style (bits number on the end).
pntohs  -> pntoh16
   pntohl  -> pntoh32
   pletohs -> pletoh16
   pletohl -> pletoh32
   phtons  -> phton16
   phtonl  -> phton32


svn path=/trunk/; revision=53652
2013-11-29 18:59:06 +00:00
Jakub Zawadzki 288efa5128 Expand macros: htoles(), htolel(), htolell()
svn path=/trunk/; revision=53651
2013-11-29 18:44:00 +00:00
Michael Mann ea278d3bf8 Remove a few (now unused) variables.
svn path=/trunk/; revision=53442
2013-11-20 01:44:06 +00:00
Guy Harris 30620ff1be Fix missing semicolon.
svn path=/trunk/; revision=53437
2013-11-19 20:06:47 +00:00
Guy Harris 06098fce7b Add routines to set the personal file directory paths (personal
configuration file directory and directory in which to save captures),
have the routine to parse -P options use them, and move that routine to
libui.

Have that routine just return a gboolean.

svn path=/trunk/; revision=53435
2013-11-19 19:45:38 +00:00
Guy Harris 67d4aaaa10 Get rid of unused trivial wrapper routine.
svn path=/trunk/; revision=53403
2013-11-18 00:51:22 +00:00
Guy Harris ed80b06a78 strncat() bad, g_strlcat() good.
svn path=/trunk/; revision=53381
2013-11-17 08:49:51 +00:00
Guy Harris d0cd9624d9 Clean up indentation.
svn path=/trunk/; revision=53380
2013-11-17 04:43:28 +00:00
Guy Harris eee9b9ddd3 Move get_tempfile_path() from filesystem.[ch] to tempfile.[ch].
svn path=/trunk/; revision=53379
2013-11-17 04:39:44 +00:00
Guy Harris db25270df8 Move the epan/filesystem.c routines to wsutil; they're not specific to
packet dissection, they're specific to the entire Wireshark suite of
programs.

svn path=/trunk/; revision=53377
2013-11-17 02:55:14 +00:00
Jakub Zawadzki bc8d5a1e61 Fix previous commit + rename to bitswap.
svn path=/trunk/; revision=53375
2013-11-16 22:44:29 +00:00
Jakub Zawadzki 004220fb63 Exporting/importing variables cause problems, so create function to do bitswaping.
svn path=/trunk/; revision=53374
2013-11-16 22:31:07 +00:00
Guy Harris 623caeeaa0 For *definitions* of external data items, we need to use
WS_DLL_PUBLIC_DEF.

svn path=/trunk/; revision=53372
2013-11-16 19:47:25 +00:00
Jakub Zawadzki 3b9f6dfab4 Move bitswap.[ch] from epan to wsutil.
svn path=/trunk/; revision=53365
2013-11-16 09:16:57 +00:00
Gerald Combs f954245491 Revert some inadvertent changes from the last commit.
svn path=/trunk/; revision=53329
2013-11-14 22:52:05 +00:00
Gerald Combs 1745e131fc Create a plural-only English translation. Use it to pluralize the Follow
Stream and Flow Graph hint statistics.

svn path=/trunk/; revision=53326
2013-11-14 22:35:10 +00:00
Gerald Combs b0063a025b Highlight selected sequence diagram items.
Create a new dialog each time the user follows a stream. A lot of the
follow code seems to assume one and only one dialog so there are likely
outstanding bugs.

Don't use the global cfile (should we deprecate its usage?). We want to
move closer to multiple documents, not further away.

Clean up after ourselves. Free our payload list and unlink our temp
file. Make a bunch of gchar*s QStrings. Make sure our destructor gets
called and use it.

Make member variable and method names more consistent.

svn path=/trunk/; revision=53306
2013-11-13 22:18:01 +00:00
Jakub Zawadzki 3b2e519422 Remove comment (leftovers from r49444) + add missing WS_DLL_PUBLIC for adler32
(modifing files to be commited when svn commit is already running is no good).

svn path=/trunk/; revision=53192
2013-11-09 14:19:19 +00:00
Jakub Zawadzki 3931cfdd79 Correct include path.
svn path=/trunk/; revision=53191
2013-11-09 14:04:52 +00:00
Jakub Zawadzki ca42cb3e40 Move adler32 from epan/ to wsutil/
The same like done for crc*

svn path=/trunk/; revision=53190
2013-11-09 14:03:53 +00:00
Jakub Zawadzki 38edae1c71 Replace wtap_nstime with nstime_t, remove wtap_nstime_to_sec.
After r50154 nstime_t is inside wsutil/ so wiretap don't need it's own copy. 

svn path=/trunk/; revision=53184
2013-11-09 10:38:02 +00:00
Jakub Zawadzki 9297c9e780 Rename swar_count_bits() to ws_count_ones()
Try to make ws_count_ones() inline function.

svn path=/trunk/; revision=53178
2013-11-09 04:47:08 +00:00
Jakub Zawadzki e6944e68b9 Try to split ws_ctz() from hfinfo_bitshift().
svn path=/trunk/; revision=53176
2013-11-08 22:01:12 +00:00
Gerald Combs ba49d9bcf0 Revert part of 52896 and (for now) all of 52935. As Jeff pointed out,
the PortableApps version relies on U3_-prefixed environment variables.

svn path=/trunk/; revision=52941
2013-10-29 04:05:27 +00:00
Gerald Combs 69741d086b Remove U3 code and packaging.
svn path=/trunk/; revision=52896
2013-10-27 17:15:39 +00:00
Michael Mann cbd3194bcf Add STANAG 5066 DTS CRC routines. Bug 9217 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9217)
STANAG 5066 DTS will follow when it passes review, just trying to make the patch more manageable.

svn path=/trunk/; revision=52774
2013-10-22 23:30:26 +00:00
Balint Reczey 2ec414c257 Minor refactoring in CMake ABI dump generation
svn path=/trunk/; revision=52689
2013-10-19 15:51:36 +00:00
Balint Reczey 70dce86ab3 Set and use TMPDIR for ABI dump generation when using CMake
svn path=/trunk/; revision=52688
2013-10-19 14:55:12 +00:00