Commit Graph

170 Commits

Author SHA1 Message Date
Daniel Mack ed0b19b94b Make boolean bitmask type 64-bit wide
There are protocols out there that have 64-bit wide bit mask fields, so
make the internal representation and bitfield decoders 64-bit aware.

For this, the ws_ctz() fallback and bits_count_ones() have to be tweaked
slightly.

Change-Id: I19237b954a69c9e6c55864f281993c1e8731a233
Reviewed-on: https://code.wireshark.org/review/4158
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: Michael Mann <mmann78@netscape.net>
2014-10-12 14:15:12 +00:00
Bill Meier a379ac74d2 Fix spelling: cant-->can't, wont-->won't, etc
Change-Id: Ia6c3e7a25615bf8e052c3bacf096d76df775c9c2
Reviewed-on: https://code.wireshark.org/review/4126
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-16 15:31:58 +00:00
Jeff Morriss 511e1fbf3e Fix up some formatting.
Change-Id: Ib38561ad5cf0f532e43ae3e10bbb857bb24ab9b6
Reviewed-on: https://code.wireshark.org/review/3980
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-09-04 01:40:37 +00:00
Jeff Morriss 054bff4f27 Fix up some white space.
Change-Id: Ie8f1006d6b3a27fe0c8187ce99051c09dea09b66
(cherry picked from commit a3a5c33dad8669e37502f2ce4d0687f7ff7e87a1)
Reviewed-on: https://code.wireshark.org/review/3257
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-07-30 02:56:41 +00:00
Evan Huus e0aabd97d8 Convert more time_to_str functions to wmem
Change-Id: Ibaae0e79935dc62f12f713f2df5b57d0f3f799b9
Reviewed-on: https://code.wireshark.org/review/2254
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-16 19:10:59 +00:00
Evan Huus de00c49bd8 Convert a bunch of time_to_str functions to wmem
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983
Reviewed-on: https://code.wireshark.org/review/2245
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-16 17:26:25 +00:00
AndersBroman 6e21a4bfcd Try to fix warning C4244: '-=' : conversion from '__int64' to 'int',
possible loss of data

Change-Id: I8cf74090e507f21eebfb40d72a3630d9f9bb0390
Reviewed-on: https://code.wireshark.org/review/1451
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-01 09:12:53 +00:00
Jakub Zawadzki 4be5e4d012 Document to_str-int.h functions.
Change argument name of hex_to_str_back pad->len it seems to sounds better.
Make uint_to_str_back_len() value uint32, to be sure about required buffer size.

Change-Id: I48fd560683c5c0845cbb60813887a18328ec01e6
Reviewed-on: https://code.wireshark.org/review/1448
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-30 22:08:36 +00:00
Jakub Zawadzki b3bb951562 Optimize display_signed_time() - remove g_snprintf
When tshark is printing columns (default) display_signed_time() is called for every frame.
Current implemention is using g_snprintf() which makes this function costly when there is lot frames.

Change-Id: I109c8699d38bfbd05475d457ae4173e937c6812d
Reviewed-on: https://code.wireshark.org/review/1447
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-30 22:07:45 +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
Alexis La Goutte c6022b3b85 Drop support of Visual Studio 2005
* Remove _MSC_VER < 1500 check
* Cleanup config.nmake

See http://www.wireshark.org/lists/wireshark-dev/201305/msg00159.html

svn path=/trunk/; revision=54965
2014-01-26 12:56:32 +00:00
Evan Huus 6be37815a1 Add bytestring_to_str() which takes a wmem scope and is otherwise identical to
bytestring_to_ep_str (now deprecated). Use the new one in a few obvious places.

Also just print directly to the buffer when loading ethernet addresses for
resolution. The straight-to-buffer bytes_to_hexstr seems useful, maybe it
shouldn't be in a private header...

svn path=/trunk/; revision=54270
2013-12-19 20:53:44 +00:00
Evan Huus 2ae8edccea Rename more to_str functions to have ep_ in the name if they return ephemeral
buffers. Remove two unused functions.

svn path=/trunk/; revision=54250
2013-12-19 16:28:39 +00:00
Evan Huus a6415ece0a Rename a couple of to_str functions to have ep_ in the name. This makes it
obvious that the returned string is ephemeral, and opens up the original names
in the API for versions that take a wmem pool (and thus can work in any scope).

svn path=/trunk/; revision=54249
2013-12-19 15:49:09 +00:00
Evan Huus b7ab4db210 Modelines and consistent indentation.
svn path=/trunk/; revision=54248
2013-12-19 15:27:44 +00:00
Jakub Zawadzki 3ae2e5ece2 Fix warnings
svn path=/trunk/; revision=53885
2013-12-09 20:15:47 +00:00
Jakub Zawadzki 9aac55472c Put "private" to_str.c functions to to_str-int.h
svn path=/trunk/; revision=53187
2013-11-09 11:26:41 +00:00
Jakub Zawadzki 68d8cad8f5 [trivial] Use g_stpcpy()
svn path=/trunk/; revision=51381
2013-08-15 09:33:52 +00:00
Guy Harris 67f849fcbc Rename octet_to_hex() to low_nibble_of_octet_to_hex() to indicate what
it actually does (it takes the low-order nibble of an octet and returns
a single character).

Cast away some warnings.

svn path=/trunk/; revision=50225
2013-06-28 22:52:24 +00:00
Jakub Zawadzki 832745df70 Use octet_to_hex() in another place.
svn path=/trunk/; revision=50223
2013-06-28 22:29:08 +00:00
Jakub Zawadzki eecbadecf4 #micro-optimization, remove g_snprintf()'s from _hfinfo_[u]int_value_format with some new fresh replacements.
svn path=/trunk/; revision=50216
2013-06-28 19:34:48 +00:00
Pascal Quantin 24623bdff3 More PDU export work:
- add automatic export of port type when exporting a source / destination port
- add export of SCTP PPID (usefulness to be checked)
- fix some field size

svn path=/trunk/; revision=49989
2013-06-17 21:54:21 +00:00
Chris Maynard 8df372bb6a Fix warning reported by MSVC:
to_str.c(262) : warning C4114: same type qualifier used more than once

svn path=/trunk/; revision=49770
2013-06-04 19:12:32 +00:00
Jakub Zawadzki efb83216f3 Change two arrays of pointer to strings, to array of characters. Save some space.
svn path=/trunk/; revision=49767
2013-06-04 18:13:09 +00:00
Anders Broman 55c498169d From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48400
2013-03-18 21:16:23 +00:00
Balint Reczey 1ebdb2e521 Export libwireshark symbols using WS_DLL_PUBLIC define
Also remove old WS_VAR_IMPORT define and related Makefile magic
everywhere in the project.

svn path=/trunk/; revision=47992
2013-03-01 23:53:11 +00:00
Pascal Quantin deb4f08cb2 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8105 :
Allow use of huges values for localtime / ctime / gmtime with MSVC 2008 or later

svn path=/trunk/; revision=46930
2013-01-04 14:56:27 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Anders Broman 1567e207a9 Try to speed up decode_bits_in_field().
svn path=/trunk/; revision=46487
2012-12-09 23:12:59 +00:00
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Guy Harris dfe0389590 Move the AX.25 address routines to address_to_str.c, where they belong;
hopefully this will fix some of the build errors.

svn path=/trunk/; revision=44219
2012-08-02 18:51:40 +00:00
Guy Harris 835111692f From Richard Stearn: support for AX.25, including support for
LINKTYPE_AX25.

svn path=/trunk/; revision=44211
2012-08-02 16:54:43 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Chris Maynard 557ab87a9b Trivial typo: of -> or
svn path=/trunk/; revision=42458
2012-05-07 04:15:10 +00:00
Gerald Combs 8b3024e57c Make bit_offset in _tvb_get_bits64 and related functions unsigned. This
removes a potential buffer overflow and should fix a bunch of Coverity
errors mentioned in bug 6878.

We might want to do the same for no_of_bits.

svn path=/trunk/; revision=41945
2012-04-04 21:54:22 +00:00
Guy Harris 0bd7a24d4b Put back the checks for null arguments, but report a dissector bug if
we're given null pointers.

Put in comments clarifying that some routines intentionally do *not*
null terminate the strings they produce.

svn path=/trunk/; revision=40194
2011-12-14 02:46:16 +00:00
Guy Harris dfe020b5f9 Back the previous change out; I'll be checking in a change to throw a
dissector bug exception in cases where a null pointer was passed, as
those really *are* dissector bugs (and I have a fix for the bug in
question in the HP Teaming heartbeat dissector, which I'll be checking
in later).

svn path=/trunk/; revision=40193
2011-12-14 02:03:05 +00:00
Chris Maynard 47116e864c Protect against NULL pointers as input. Based on the stacktrace provided, this should avoid crashes reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6634
svn path=/trunk/; revision=40176
2011-12-13 16:50:34 +00:00
Bill Meier 4f420ef6cd Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings
svn path=/trunk/; revision=37600
2011-06-07 22:28:55 +00:00
Jakub Zawadzki 453d0a8568 Introduce ip6_to_str_buf_len (little cleaner version of inet_ntop6 from wsutil/inet_ntop.c)
and use it instead of inet_ntop(AF_INET6, ...)

- Add MAX_IP6_STR_LEN define.
- use MAX_IP6_STR_LEN as a buffer size when ip6_to_str_buf() is used.

svn path=/trunk/; revision=37000
2011-05-05 20:48:21 +00:00
Chris Maynard ee36a5cfbe Use g_strlcat instead of strcat: Coverity 632.
svn path=/trunk/; revision=36598
2011-04-12 18:16:55 +00:00
Jaap Keuter 1be49d98a5 From Matthew Parris:
Display "Day of Year" for January 1 as 1, not 0.

svn path=/trunk/; revision=35949
2011-02-15 07:14:22 +00:00
Stig Bjørlykke 3d11d9c9d9 Print "0 seconds" when time_val==0 in functions converting seconds to string.
svn path=/trunk/; revision=35640
2011-01-24 19:33:36 +00:00
Bill Meier 2276b10ddf Add a comment about not needing to g_free() the value returned from g_locale_to_utf8().
svn path=/trunk/; revision=35240
2010-12-21 21:01:01 +00:00
Bill Meier 7d0c23a125 Fix a GCC error.
svn path=/trunk/; revision=35087
2010-12-01 02:18:01 +00:00
Bill Meier bd793cd800 On Windows: convert _tzname[] strings from the system charset to UTF8 before use.
In the Windows C Runtime the strings in the global array _tzname[]
   are encoded using the "system default ansi code page".
   They must be converted to UTF8 before use by Wireshark/GTK.
   (See comment in the code for details).

   Fixes Bug #5421 (I hope).
   https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5421

Also: Fix bug: when the timezone name is not available from the system
      ?ST was used when ?DT should have been used (and vice-versa).

svn path=/trunk/; revision=35086
2010-12-01 01:31:49 +00:00
Guy Harris 927b7da346 Have abs_time_to_str() and abs_time_to_str_secs() take an additional
argument indicating whether to include the time zone in the string.  If
we're constructing a display filter, don't include the time zone,
otherwise do.  Fixes bug 4756.

svn path=/trunk/; revision=32913
2010-05-21 06:33:25 +00:00
Bill Meier 6812b68eb1 From Yaniv Kaul: constify parameters
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422

 From me: Fix a number of instances where the function prototype or
  the function definition wasn't changed so there was a mismatch 
  thus causing Windows (but not gcc) compilation errors.

svn path=/trunk/; revision=32365
2010-04-03 18:18:50 +00:00
Bill Meier d32b4c0758 Revert SVN #32360 until Windows compilation errors corrected.
svn path=/trunk/; revision=32361
2010-04-02 15:18:03 +00:00
Bill Meier 049f9eac85 From Yaniv Kaul: constify parameters
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422

svn path=/trunk/; revision=32360
2010-04-02 14:37:49 +00:00