Commit Graph

25 Commits

Author SHA1 Message Date
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
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Bill Meier 638d74d43f Use val_to_str_const() where appropriate;
Also (for a few files):
- create/use some extended value strings;
- remove unneeded #include files;
- remove unneeded variable initialization;
- re-order fcns slightly so prefs_reg_handoff...() at end, etc

svn path=/trunk/; revision=44438
2012-08-10 22:55:02 +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
Bill Meier c4b63360dc Fix proto_tree_add_item( encoding args;
Do whitespace cleanup (for a few files).

svn path=/trunk/; revision=39640
2011-10-27 20:30:38 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Bill Meier 126aa85393 Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, FT_STRINGZ, FT_UINT_STRING as follows:
1. If there's no character encoding (ENC_ASCII, ...) specified
    then use ENC_ASCII.
 2. For all but FT_UINT_STRING, always use ENC_NA
    (replacing any existing True/1/FALSE/0
    /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN).



svn path=/trunk/; revision=39426
2011-10-15 18:46:26 +00:00
Bill Meier 4e57694d4a Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
 the encoding parameter for proto_tree_add_item() calls which directly reference
 an item in hf[] which has a type of:
    FT_UINT8
    FT_UINT16
    FT_UINT24
    FT_UINT32
    FT_UINT64
    FT_INT8
    FT_INT16
    FT_INT24
    FT_INT32
    FT_INT64
    FT_FLOAT
    FT_DOUBLE


svn path=/trunk/; revision=39288
2011-10-06 03:35:44 +00:00
Bill Meier 94f36ca4ff Use ENC_NA as encoding for proto_tree_add_item() calls which directly reference an hf item (in hf[] with types:
FT_NONE
   FT_BYTES
   FT_IPV6
   FT_IPXNET
   FT_OID

Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN

svn path=/trunk/; revision=39260
2011-10-04 22:44:31 +00:00
Jeff Morriss 4ee4fc1d53 Avoid passing a NULL string pointer to format routines: some libc's (e.g.,
Solaris') will seg-fault on that.

svn path=/trunk/; revision=36784
2011-04-21 22:38:41 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +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 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +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 7afd9b0c3b From Jakub Zawadzki:
Cleanup dissector code - use proper memory functions.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164

svn path=/trunk/; revision=31408
2010-01-02 09:46:16 +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
Stig Bjørlykke 0fcef72fc6 Use correct type for udp port preference.
svn path=/trunk/; revision=30603
2009-10-18 21:13:17 +00:00
Jaap Keuter 75f1e13c12 Cleanup header fields.
svn path=/trunk/; revision=30394
2009-10-07 23:08:22 +00:00
Jaap Keuter 7afe46bf86 From Florian Forster:
Version 4.8.0 of collectd introduced two new data source types: DERIVE and ABSOLUTE. 
With this patch support for the new data source types is added so they are displayed correctly.

svn path=/trunk/; revision=29947
2009-09-16 19:02:51 +00:00
Jeff Morriss 6e7a37fe34 From Florian Forster via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3185
This patch adds statistics information to the collectd dissector.

Changes by me:
  - use ep_alloc for structures being handed to the tap(s) (instead of se_alloc)
  - Capitalize the Statistics menu item to get it in the sorted list

svn path=/trunk/; revision=29915
2009-09-15 01:34:01 +00:00
Jeff Morriss 623b634080 From Florian Forster via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4002
Version 4.7 of collectd introduces cryptographic features for the network
protocol. The current version of the collectd dissector does not know how to
handle these segments and flags them as unknown.

The following two patches add simple support for the TYPE_SIGN_SHA256 and
TYPE_ENCR_AES256 segments. They display the plain text components of
these segments but do not try to verify the signatures or decrypt the encrypted
payload.

Changes by me:
	- replace tvb_length_remaining() with tvb_reported_length_remaining()
	- replace proto_tree_add_protocol_format() with tvb_tree_add_text()

svn path=/trunk/; revision=29913
2009-09-15 00:18:40 +00:00
Jeff Morriss f2c8d78562 Put the parenthesis in the right place
svn path=/trunk/; revision=29894
2009-09-14 13:11:26 +00:00
Jeff Morriss 87cb19aa15 Change proto_tree_add_protocol_format() to proto_tree_add_text() since all that is being added is text.
svn path=/trunk/; revision=29893
2009-09-14 11:26:03 +00:00
Anders Broman a591c7a074 Add casts to make it compile on Windows.
svn path=/trunk/; revision=29888
2009-09-14 05:59:38 +00:00
Jeff Morriss d642dc9f41 From Bruno and Florian Forster via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3170
This patch adds support to Wireshark for dissecting UDP packets used by
collectd's network plugin in order to transmit data from ones host to another
host (e.g. centralized storage of statistics while data is collectd on
individual systems)

The current dissector understands the part types supported by collectd-4.5
series and gracefully processes future part types (flagging them as unknown).

In regard to protocol errors or bad packets checks are based on the various
length fields used, parts are marked with warning when length is unexpected;
marked with error when length breaks minimal rules.

svn path=/trunk/; revision=29887
2009-09-14 01:36:26 +00:00