Commit Graph

242 Commits

Author SHA1 Message Date
Andrew Chernyh 3268023b87 Added TDMoP protocol dissector
Bug: 11340
Change-Id: I04408db376718c7a5392f9521d7d75d0481ec30e
Reviewed-on: https://code.wireshark.org/review/9514
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-19 04:17:41 +00:00
Evan Huus a2e2c1f997 Fix memory leak printing eui64s
The scope that is passed in should only be used for the return value - other
temporary buffers we must alloc/free ourselves, since if the scope is NULL they
will not be managed automatically.

Bug: 11293
Change-Id: I27be856f1c5cdf47f78e766192a29523664a543e
Reviewed-on: https://code.wireshark.org/review/9007
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-21 18:40:01 +00:00
Moeller, Thies 924093cc02 fix FT_UINT64 fields output in tshark
Bug: 11170
Change-Id: Ica259867e2c8e0b4b680bca94970e13962a8dbb1
Reviewed-on: https://code.wireshark.org/review/8290
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-05-07 07:24:39 +00:00
Michael Mann baa83912e3 Eliminate decode_bitfield_value from "public" use.
This "encourages" (forces) dissectors to use the bitmask field of the header_field_info structure to get "bitmask formatting" of a field.

other_decode_bitfield_value should be treated the same (eventually eliminated), but there are still replacements to be made in the dissectors.

Change-Id: I8a0d829c3fef2d5e5a588667a259e231bca559e6
Reviewed-on: https://code.wireshark.org/review/7736
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-03-19 04:33:26 +00:00
Guy Harris f12d231024 More wrapping of constants with G_GUINT64_CONSTANT().
Change-Id: I11771b08cc4e57692c42dd3fc8976fe390b3025d
Reviewed-on: https://code.wireshark.org/review/7299
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-21 20:08:06 +00:00
Guy Harris 1694e81abe The shortening to 32 bits is intentional, so add a cast.
The cast reassures the compiler that we do, in fact, know what we're
doing, so it doesn't issue a warning.

Change-Id: Ie3bc4e1c955f9c5cad5506e26fc72e12f7a8f854
Reviewed-on: https://code.wireshark.org/review/7295
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-21 19:35:43 +00:00
JC Wren e2bcee6ac4 Make FT_{U}INT64 behave more like FT_{U}INT32, add support for FT_{U}INT{40,48,56}
Change-Id: I57354c309ecf3a0c8f0c7cff485638027f30bb19
Reviewed-on: https://code.wireshark.org/review/5813
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-21 16:57:52 +00:00
Michael Mann 8ff944d4ab Add fixed length function for address types.
This allows for even more cleanup with respect to how address types are handled, including removing address_to_str.c.  Most of the functionality was folded into address_types.c, but the remainder was just dispersed because it didn't make sense to keep the file.

Change-Id: Id4e9391f0c3c26eff8c27b362e4f7a1970d718b4
Reviewed-on: https://code.wireshark.org/review/7038
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-09 03:49:13 +00:00
Michael Mann 4497bb48fd Add address type registration.
Now address types are setup just like field types and must be registered with a structure that provides its string representation (and more things in the future).  Address types that are limited to a single dissector are registered by the dissector.  More "common" ones are globally registered.  There are still a few that really belong in a dissector, but have other dependencies currently not accounted for in the address type support.

Many of the "address to string" conversions that involved g_sprintf have be changed to use more "performance friendly" methods (some at the cost of needing to_str-int.h)

Leaving all comments regarding this "solution" in address_to_str.c in until all have been implemented

Change-Id: I494f413e016b22859c44675def11135f228796e0
Reviewed-on: https://code.wireshark.org/review/7019
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-09 01:12:01 +00:00
Guy Harris 44e7ce54ff Remove some apparently-unnecessary includes of emem.h.
Change-Id: Ib7d1b587b439ff21ec6b7f1756ce6ccf25b66f80
Reviewed-on: https://code.wireshark.org/review/6635
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 20:19:05 +00:00
Michael Mann 0ad15f88cc Replace the last of ep_alloc and ep_alloc0 with wmem equivalent.
Change-Id: I0338d0acda5e4b9957aad4825ca2cfd6fa506ead
Reviewed-on: https://code.wireshark.org/review/6596
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-17 23:23:06 +00:00
Alexis La Goutte 0f6b09d32e to_str (epan): fix parameter 'scope' not found in the function declaration [-Wdocumentation]
Change-Id: Ie414d28415b71a79780d37fae454b90a7a610e1c
Reviewed-on: https://code.wireshark.org/review/6475
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-10 15:52:40 +00:00
Michael Mann cff098e3eb guid_to_ep_str -> guid_to_str
guid_to_str now uses wmem allocation.

Change-Id: I8e48d1a720942fbefbaa6227ae0929cb9f856359
Reviewed-on: https://code.wireshark.org/review/6391
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-08 07:18:09 +00:00
Michael Mann 5d610b58c5 Remove decode_numeric_bitfield.
It was only used by 1 dissector and that dissector can just use bitmasking in the hf_ field.

Change-Id: I99179356dd7cbfab0c7be1512357a7e4c0eecde6
Reviewed-on: https://code.wireshark.org/review/6390
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-08 05:46:26 +00:00
Michael Mann 4a5ca5c76e bytes_to_ep_str -> bytes_to_str
Change-Id: Ifcda8328dedec0ef4104c3a124d6246f99493750
Reviewed-on: https://code.wireshark.org/review/6389
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-08 05:43:51 +00:00
Guy Harris 5e8c053d68 Squelch a compiler warning.
No need for buflen to be bigger than len, which it will be on LP64 and
LLP64 platforms if it's size_t and len is guint32.

Change-Id: Iffd2940187180cde1ad55ff7d3bd7c45acf22eba
Reviewed-on: https://code.wireshark.org/review/6380
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-07 19:43:40 +00:00
Michael Mann 98d3b1494b Replace bytes_to_ep_str_punct with wmem equivalent.
Change-Id: I8aa7d7374db94685fd875cbf358c3bfbc83f3255
Reviewed-on: https://code.wireshark.org/review/6370
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-07 18:12:35 +00:00
Michael Mann 9cfe67fde6 tvb_bytes_to_ep_str_punct -> tvb_bytes_to_str_punct
Also change bytestring_to_str to match bytes_to_ep_str_punct functionality (limiting byte string size)

Change-Id: Idb958c7f0c203d103629469302b81fa922714f7e
Reviewed-on: https://code.wireshark.org/review/6369
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-07 18:05:35 +00:00
Michael Mann 493f03b420 Remove bytestring_to_ep_str
Use wmem equivalent bytestring_to_str

Change-Id: I1ec7509e3adb36ab0f65317459653cb3b4b11af8
Reviewed-on: https://code.wireshark.org/review/6368
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-07 18:01:15 +00:00
Michael Mann 55de46f317 Replace ep_address_to_str with address_to_str.
Change-Id: I4f1078b20f41800f72a751612703ad0d4c2ae87b
Reviewed-on: https://code.wireshark.org/review/6323
Reviewed-by: Michael Mann <mmann78@netscape.net>
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-01-06 07:38:18 +00:00
Hadriel Kaplan fac8356610 Make all Lua code use wmem not emem
Changed all remaining code in wslua that was using emem, to use wmem or
simpler methods.

Bug: 9927
Change-Id: I3d19a770e0fd77d996bdb6b61a76a722cc2bcd55
Reviewed-on: https://code.wireshark.org/review/6109
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-04 21:02:38 +00:00
Pascal Quantin b3ad51db7c Follow-up of ged0b19b (Make boolean bitmask type 64-bit wide)
- use G_GINT64_MODIFIER instead of "%ll"
- use G_GUINT64_CONSTANT instead of ULL
- add some missing explicit casts

Change-Id: Ic048d9ee8966ea504ea542cefe55688edcfb2dc7
Reviewed-on: https://code.wireshark.org/review/4644
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-13 15:34:09 +00:00
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
Guy Harris adde80ad43 From Jakub Zawadzki: split off the address-to-string functions, except
for ip_to_str_buf(), into address_to_str.c.

Fix up the SVN attributes for time_fmt.h while we're at it.

svn path=/trunk/; revision=32038
2010-02-27 21:41:12 +00:00
Guy Harris 45bed99e2b Squelch some compiler warnings.
svn path=/trunk/; revision=32036
2010-02-27 20:12:47 +00:00
Guy Harris 500eb99cd9 Add a third date format, ABSOLUTE_TIME_DOY_UTC, to show UTC with the
date as YYYY/DDD, where DDD is a 1-origin day of year.  Move the formats
to a "time_fmt.h" file, included by the headers that use it.  Have
abs_time_to_str() and abs_time_secs_to_str() take the date format value,
rather than a Boolean "show this as UTC" flag, as an argument.  Document
the ABSOLUTE_TIME_ formats a bit better.  Use that format in the CCSDS
and VCDU dissectors, rather than having those dissectors do the
formatting themselves.

svn path=/trunk/; revision=32034
2010-02-27 19:01:27 +00:00
Anders Broman 35574147d7 From Jakub Zawadzki:
Don't sigsegv on negative bd_len in bytes_to_str*

svn path=/trunk/; revision=31986
2010-02-24 12:59:09 +00:00
Anders Broman 4e66c899d1 From Jakub Zawadzki:
Optimizations.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4303

svn path=/trunk/; revision=31967
2010-02-23 19:28:38 +00:00
Bill Meier 9d663d7081 Fix various gcc -Wshadow warnings.
svn path=/trunk/; revision=31720
2010-01-28 18:45:46 +00:00
Bill Meier e0064797fb Use more unique names for certain enum constants.
(enum constant names are part of the global name space).
(Fixes at least one gcc -Wshadow warning).

svn path=/trunk/; revision=31572
2010-01-19 19:37:03 +00:00
Guy Harris 818b8c3878 Protect against localtime() failing.
svn path=/trunk/; revision=31238
2009-12-11 08:08:05 +00:00
Guy Harris 38316e0483 The pointer is "tmp", not "tm".
svn path=/trunk/; revision=31237
2009-12-11 07:17:09 +00:00
Guy Harris 229b262e15 Squelch warnings.
svn path=/trunk/; revision=31236
2009-12-11 07:14:52 +00:00
Guy Harris 488253bfe7 Add the time zone abbreviation to the result of abs_time_to_str() and
abs_time_secs_to_str().

svn path=/trunk/; revision=31234
2009-12-11 03:39:17 +00:00
Guy Harris 4fde145bd2 Add an argument to abs_time_to_str() and abs_time_secs_to_str()
indicating whether the time should be shown as local time or UTC.  For
now, always pass FALSE, meaning "show as local time".

Clean up some stuff in the SNMP dissector, use abs_time_secs_to_str()
for times with one-second resolution, and update a comment in various
macros in the WSP dissector, while we're at it.

svn path=/trunk/; revision=31227
2009-12-10 22:19:29 +00:00
Guy Harris 4ac5594f7b Note that there are similar functions to the "to_hexstr" functions
in strutil.c.

svn path=/trunk/; revision=31212
2009-12-09 01:31:41 +00:00
Stig Bjørlykke d71b1088f7 From Jakub Zawadzki:
Fix win64 build.

svn path=/trunk/; revision=31204
2009-12-08 10:17:37 +00:00
Anders Broman e59f952b98 From Jakub Zawadzki:
Replace some g_snprintf() with 'probably' faster version.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4303

svn path=/trunk/; revision=31201
2009-12-08 07:45:06 +00:00
Anders Broman 88bb44a51e From Jakub Zawadzki:
Cleanup dissector code - use proper memory functions.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164

svn path=/trunk/; revision=30691
2009-10-25 11:43:30 +00:00
Kovarththanan Rajaratnam d6122ad422 Reorder file to group related functionality
svn path=/trunk/; revision=29753
2009-09-06 15:06:41 +00:00
Kovarththanan Rajaratnam f641693bf4 Change se_address_to_str() to call address_to_str_buf() directly
svn path=/trunk/; revision=29748
2009-09-06 14:39:53 +00:00
Kovarththanan Rajaratnam 8c48c6835f Rename address_to_str() to ep_address_to_str() because:
1) This indicates that the string has ephemeral lifetime
2) More consistent with its existing seasonal counterpart, se_address_to_str().

svn path=/trunk/; revision=29747
2009-09-06 14:25:47 +00:00
Stig Bjørlykke f900d9c3a5 From Jakub Zawadzki via bug 3701:
Fix regressions in r29130 and r29133
In r29130 formating for DSECS was changed. (old: %01d now: %02d)
In r29133 adding sign was removed (old: buf[0] = '-' now: buf[0] = '\0')

svn path=/trunk/; revision=29146
2009-07-20 12:40:55 +00:00
Gerald Combs 25e7cac69d Fix an ep buffer overrun introduced in r29130.
svn path=/trunk/; revision=29133
2009-07-17 15:59:24 +00:00
Anders Broman 3278582767 From Kovarththanan Rajaratnam:
Optimize column fill path.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3701

svn path=/trunk/; revision=29130
2009-07-17 08:24:06 +00:00
Anders Broman 23b068e307 Introduce se_address_to_str()
svn path=/trunk/; revision=28973
2009-07-07 09:42:09 +00:00
Stig Bjørlykke 1ec579f62b Unsigned does not have msign.
svn path=/trunk/; revision=28842
2009-06-25 02:13:35 +00:00
Stig Bjørlykke 7221f30ab3 From Nathan Hartwell via bug 2733:
Added time_secs_to_str_unsigned().

svn path=/trunk/; revision=28840
2009-06-25 02:07:17 +00:00
Anders Broman 1464f7ca84 Introduce decode_bits_in_field() and use it.
clean up some left owers from previous checkin.

svn path=/trunk/; revision=28373
2009-05-15 18:38:13 +00:00
Gerald Combs d6d9e7afdc Fix the last commit.
svn path=/trunk/; revision=28001
2009-04-08 17:55:35 +00:00
Gerald Combs c2ae798ae2 More size_t fixes.
svn path=/trunk/; revision=28000
2009-04-08 17:31:12 +00:00