Commit Graph

60 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
Michael Mann 1741731384 remove unnecessary underscores from display filters
svn path=/trunk/; revision=44181
2012-08-01 02:59:17 +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 5e3066f006 Use dscp_vals_ext everyplace (instead of dscp_vals);
(dscp_vals is now a static array in packet-ip.c)

svn path=/trunk/; revision=43211
2012-06-11 19:07:53 +00:00
Michael Tüxen 24fa3fb59a No leading whitespaces in the INFO column.
svn path=/trunk/; revision=42679
2012-05-17 15:31:15 +00:00
Michael Tüxen 6526ea3751 Add support for specifying an SCTP port number.
svn path=/trunk/; revision=42677
2012-05-17 14:34:09 +00:00
Anders Broman 6819789c54 From Bodo Petermann:
Megaco parser problem with LF in header.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7198

svn path=/trunk/; revision=42258
2012-04-26 13:22:40 +00:00
Jakub Zawadzki 68ec58d385 Fix some: 'cast discards qualifiers from pointer target type' warnings
- Add const qualifier
- Remove some strange casts

svn path=/trunk/; revision=42131
2012-04-18 12:35:36 +00:00
Alexis La Goutte 1dee4d224e Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=41469
2012-03-10 17:49:33 +00:00
Chris Maynard 2a808af4da Fix some typos.
svn path=/trunk/; revision=40454
2012-01-13 16:05:23 +00:00
Anders Broman 4730454aad Accpet lover case Topology descriptor (tp) as we accept other tokens in lowercase.
svn path=/trunk/; revision=40104
2011-12-06 19:10:13 +00:00
Anders Broman e1b386b5fc Fix length of Error parameter.
svn path=/trunk/; revision=40103
2011-12-06 19:08:01 +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 3af6394891 Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings
svn path=/trunk/; revision=38001
2011-07-13 19:48:58 +00:00
Jeff Morriss f3f9f2697f Make TVBs opaque for most users.
Convert TVB_RAW_OFFSET() and TVB_GET_DS_TVB() into functions.

svn path=/trunk/; revision=37422
2011-05-27 03:06:50 +00:00
Bill Meier a2b58f051d Add #include <stdlib.h> to files which reference fcns declared in stdlib.h;
(In many cases I previously incorrectly removed the #include <stdlib.h>).

svn path=/trunk/; revision=37334
2011-05-20 19:00:09 +00:00
Jeff Morriss 24c9bb76b0 Don't create a subtree that is not used.
svn path=/trunk/; revision=36805
2011-04-22 14:17:34 +00:00
Bill Meier 5f57b0d828 Don't assign to a variable if the value won't be used: Coverity 964 & 965;
Also:
- Move proto_register...() & proto_reg_handoff...() to the end of the file;
- Remove some unneeded #includes;
- Do some indentation and whitespace cleanup (e.g., "4-space tabs").

svn path=/trunk/; revision=36556
2011-04-11 14:41:14 +00:00
Anders Broman 771445d49a from Václav Horčák:
Bug 5663 - [PATCH] Fix for MEGACO dissector context tracking.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5663

svn path=/trunk/; revision=35880
2011-02-08 12:33:34 +00:00
Anders Broman 6d269f2713 From Václav Horčák:
Fix keeps  parser function in scope of current transactions, allowing multiple
transaction in one packet. 

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3420

svn path=/trunk/; revision=35814
2011-02-04 11:45:37 +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
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Anders Broman bc9a809b65 From Didier Gautheron:
ep memory can't be used for tvbs defined as data_source.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4054

svn path=/trunk/; revision=30376
2009-10-06 19:15:58 +00:00
Kovarththanan Rajaratnam 00810ff199 * Prefer col_append_str instead of col_append_fstr for constant strings
* Remove check_col guards

svn path=/trunk/; revision=30127
2009-09-24 20:21:23 +00:00
Kovarththanan Rajaratnam 4b6090e576 Don't guard col_set_str (COL_INFO) with col_check
svn path=/trunk/; revision=29342
2009-08-09 07:01:26 +00:00
Kovarththanan Rajaratnam e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +00:00
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
Anders Broman c91a384702 Apply some of the patches from:
http://wiki.wireshark.org/Development/Optimization

svn path=/trunk/; revision=28356
2009-05-13 19:46:11 +00:00
Bill Meier 808a4e2c3c Define certain fcns as static (if not used externally).
Also: whiule we're at it: 
 - fix hf[] blurbs as appropriate to use NULL;
 - fix some indentation

svn path=/trunk/; revision=27890
2009-03-29 22:16:26 +00:00
Balint Reczey 10ab8cc28d Fix inverted interpretation of global_megaco_dissect_tree.
svn path=/trunk/; revision=27716
2009-03-13 16:51:40 +00:00
Balint Reczey 4dab0f663e Show topology descriptor using unescaped whitespaces.
svn path=/trunk/; revision=27131
2008-12-30 12:23:28 +00:00
Balint Reczey 2c77634418 Do not dissect descriptors twice after topology descriptor.
svn path=/trunk/; revision=27130
2008-12-30 11:22:49 +00:00
Balint Reczey 824e42a248 Fixed topology descriptor dissection.
svn path=/trunk/; revision=27129
2008-12-30 10:25:05 +00:00
Bill Meier c0e92cbc04 Fix various typos and spelling errors (mostly in text strings)
svn path=/trunk/; revision=27065
2008-12-20 00:09:02 +00:00
Balint Reczey f763c88092 Try to dissect the Topology Descriptor before the command
This fixes bug 2665

svn path=/trunk/; revision=26620
2008-10-30 09:53:43 +00:00
Balint Reczey bafe19e58d fixes some parsing errors revealed by fuzz tests
svn path=/trunk/; revision=26618
2008-10-29 16:24:58 +00:00
Bill Meier 9d203cb9c6 Fix some imdentation
svn path=/trunk/; revision=26223
2008-09-17 03:27:40 +00:00
Bill Meier 618f722102 Minor cleanup related to proto_reg_handoff
svn path=/trunk/; revision=26222
2008-09-17 03:21:55 +00:00
Anders Broman 6444284b59 packet-megaco.c:2208: warning: unused parameter 'pinfo'
svn path=/trunk/; revision=25872
2008-07-30 13:38:31 +00:00
Anders Broman 68c6088a51 From Mike Davies:
The MEGACO dissector issues an error when a command "AuditValue" is captured
[Packet size limited during capture: MEGACO truncated], but the packet seems to
be OK. See the example attached.

svn path=/trunk/; revision=25868
2008-07-30 12:02:34 +00:00
Jeff Morriss a5c48c4c6f Don't use proto_tree_add_string_hidden() any more: it's deprecated.
svn path=/trunk/; revision=25808
2008-07-23 21:04:48 +00:00
Guy Harris 83fc9d5e09 Constify a bunch of stuff, to squelch -Wwrite-strings warnings.
epan/dissectors/packet-ncp2222.inc is a bit hard to fix, so we're not
ready to enable that warning by default yet.

Throw in some casts to handle GLib routines that take arbitrary
non-const pointers (they can later return the pointers, and some
callers might want to modify or free up those pointers in cases where
they're known to be writable or allocated).

Use ep_tvb_memdup() rather than a combination of ep_alloc() and
tvb_memcpy().

Clean up some indentation.

svn path=/trunk/; revision=25601
2008-06-25 09:12:35 +00:00
Anders Broman d03fa8ee26 If H.248 is in otp internal format call the h248_otp dissector, work in progress.
svn path=/trunk/; revision=25310
2008-05-16 16:34:23 +00:00
Bill Meier 931cc922a1 Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25305
2008-05-15 01:44:53 +00:00
Anders Broman 63c5c71cf8 Remove:
#ifdef NEED_G_ASCII_STRCASECMP_H
#include "g_ascii_strcasecmp.h"
#endif

svn path=/trunk/; revision=24859
2008-04-09 05:36:08 +00:00
Stig Bjørlykke 28ae535b00 Removed even more "statement not reached" warnings.
svn path=/trunk/; revision=24286
2008-02-07 15:44:45 +00:00
Anders Broman e5f48395f1 Move the routines tvb_skip_wsp() to tvbuff.c
svn path=/trunk/; revision=23818
2007-12-09 17:41:16 +00:00
Guy Harris 9c89cdaaa3 strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delenda
est.  Use g_ascii_strcasecmp() and g_ascii_strncasecmp(), and supply our
own versions if they're missing from GLib (as is the case with GLib
1.x).

In the code to build the list of named fields for Diameter, don't use
g_strdown(); do our own g_ascii_-style upper-case to lower-case mapping
in the hash function and use g_ascii_strcasecmp() in the compare
function.

We do this because there is no guarantee that toupper(), tolower(), and
functions that use them will, for example, map between "I" and "i" in
all locales; in Turkish locales, for example, there are, in both
upper case and lower case, versions of "i" with and without a dot, and
the upper-case version of "i" is "I"-with-a-dot and the lower-case
version of "I" is "i"-without-a-dot.  This causes strings that should
match not to match.

This finishes fixing bug 2010 - an earlier checkin prevented the crash
(as there are other ways to produce the same crash, e.g. a bogus
dictionary.xml file), but didn't fix the case-insensitive string matching.

svn path=/trunk/; revision=23623
2007-11-27 18:52:51 +00:00