Commit Graph

68 Commits

Author SHA1 Message Date
Evan Huus 37600a157b Rename value string (and similar) functions to use a consistent pattern. This
was done using textual search+replace, not anything syntax-aware, so presumably
it got most comments as well (except where there were typos).

Use a consistent coding style, and make proper use of the WS_DLL_* defines.

Group the functions appropriately in the header.

I ended up getting rid of most of the explanatory comments since many of them
duplicated what was in the value_string.c file (and were out of sync with the
recent updates I made to those in r48633). Presumably most of the comments
should be in the .h file not the .c file, but there's enough churn ahead that
it's not worth fixing yet.

Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467

svn path=/trunk/; revision=48634
2013-03-29 00:26:23 +00:00
Anders Broman 2e52e2ac99 [-Wmissing-prototypes]
Use explicit casts.

svn path=/trunk/; revision=48347
2013-03-17 09:11:21 +00:00
Bill Meier c439b805e2 Comment out unused hf[] entries & etc.
(found by checkhf)

svn path=/trunk/; revision=47389
2013-01-31 17:55:31 +00:00
Michael Mann 5d026123c4 Make eDonkey dissector a "new style" and only dissect if first byte matches a valid eDonkey protocol. This addresses the problem of Bug 3033 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3033), but I'm still not sure eDonkey should have explicitly registered TCP and UDP ports.
svn path=/trunk/; revision=47349
2013-01-29 18:16:23 +00:00
Michael Mann 23168c9677 Get Server Info should not have any data unless "challenged", per eMule source code. Addresses bug 3509 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3509).
Also updated documentation links.

svn path=/trunk/; revision=47345
2013-01-29 15:43:33 +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 b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +00:00
Jakub Zawadzki 760559b957 Simplify proto_tree_add_string_format_value(..., val, "%s", val) with proto_tree_add_string.
hash is 16-bytes hex dump (ASCII!). No need to use proto_tree_add_string_format_value().

svn path=/trunk/; revision=43386
2012-06-19 19:50:43 +00:00
Alexis La Goutte 1f0cbf3baa Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=42362
2012-04-30 21:15:17 +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 67ee5049d4 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_BOOLEAN
     FT_IPv4
     FT_EUI64
     FT_GUID
     FT_UINT_STRING

Also: For type FT_ITv6 use ENC_NA. (This was missed in SVN #39260)

svn path=/trunk/; revision=39328
2011-10-10 00:39:31 +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
Bill Meier b3c8baf2d5 Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings
svn path=/trunk/; revision=37999
2011-07-13 18:42:40 +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
Stig Bjørlykke 1c45c1a243 From Michael Mann via bug 2794:
Fixed display filters with obvious typos.

svn path=/trunk/; revision=36713
2011-04-19 08:22:58 +00:00
Bill Meier 2674aeb1ff Don't assign to a proto_item * if the value won't be used: Coverity 891 & 892;
Also: #include <stdlib.h> & <string.h> not req'd;  fix some indentation.


svn path=/trunk/; revision=36528
2011-04-09 13:44:00 +00:00
Bill Meier fa8fb80f53 Use tvb_bytes_to_str() iso home-grown hex output fcn.
svn path=/trunk/; revision=35734
2011-01-31 21:35:48 +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
Jaap Keuter ea3407dc59 From Andrew Jean:
When dissecting an eDonkey "Request Parts" message, Wireshark incorrectly reads
3 offset start/end pairs when the actual number can be 1-3 pairs.

svn path=/trunk/; revision=31071
2009-11-25 06:39:29 +00:00
Anders Broman 565b8c922c From Jakub Zawadzki:
Fix memleaks while creating kademlia hash.

svn path=/trunk/; revision=30702
2009-10-26 05:55:07 +00:00
Jeff Morriss 6ea2688f23 From zeemon via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3848 :
epan\dissectors\packet-edonkey.c
In the fuction dissect_emule_sourceOBFU(): the line

ti = proto_tree_add_item(tree, hf_emule_sourceOBFU, tvb, offset, 7 + ((settings & 0x08) ? 16 : 0), FALSE);

should be

ti = proto_tree_add_item(tree, hf_emule_sourceOBFU, tvb, offset, 7 + ((settings & 0x80) ? 16 : 0), FALSE);

and, the line:

if (settings & 0x08)

should be:

if (settings & 0x80)

That is, 0x08 should be revised to 0x80.

reference: the eMule0.49c source code, file PartFile.cpp, line 2730, in the
function CPartFile::AddSources().

svn path=/trunk/; revision=29957
2009-09-17 02:37:57 +00:00
Kovarththanan Rajaratnam 0a5b014cec Don't guard col_clear with col_check
svn path=/trunk/; revision=29344
2009-08-09 07:36:13 +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
Jaap Keuter ba01060178 From Jakub Zawadzki:
Fix edonkey dissector a little, by using gint type for tvb_length_remaining() result.

svn path=/trunk/; revision=28640
2009-06-04 17:37:48 +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 a8f30cbca1 Fix some typos and spelling (mostly in text strings)
svn path=/trunk/; revision=27037
2008-12-17 17:23:37 +00:00
Bill Meier 33c99f44fd Fix typos and spelling (mostly in text strings)
svn path=/trunk/; revision=27028
2008-12-17 00:08:38 +00:00
Stig Bjørlykke bd08ae7ee6 Fix some "format not a string literal and no format arguments" warnings.
svn path=/trunk/; revision=26647
2008-10-31 15:11:57 +00:00
Anders Broman ae07b1708a From Stefan Monhof:
Fix a bug in the previous patch.

svn path=/trunk/; revision=26065
2008-08-24 19:25:33 +00:00
Anders Broman 924894e617 From: Stefan Monhof:
changes:
- fixed: display of kademlia hash (bug #2348)
- added: information on the meaning of the values of kad version, parameter of
message types KADEMLIA_REQ and KADEMLIA2_REQ, metatag sourcetype and metatag
encryption
- added: peer id, target id, recipients id, file id, keyword hash as variants
of kademlia hash (searchable as string now)
- added: xor between target id and recipients id
- fixed: ip adresses in taglist now displayed in dotted-decimal (instead of
int)
- fixed: some values in taglist were displayed in octal, it's hex now
- fixed: message type KADEMLIA2_BOOTSTRAP_REQ was wrongly marked as malformed
- added: differences in dissecting peer list 1.0 and peer list 2.0
- fixed: dissection of KADEMLIA2_SEARCH_KEY_REQ and KADEMLIA2_SEARCH_RES
- added: source-publishing and keyword-publishing in KADEMLIA_PUBLISH_REQ
- fixed: decompressed data are not displayed in a subtree anymore

svn path=/trunk/; revision=26063
2008-08-24 15:15:36 +00:00
Bill Meier f8e3822738 Fix some warnings reported by gcc -Wshadow ...
Fix some spacing in packet-dcom.c

svn path=/trunk/; revision=25618
2008-06-27 16:15:30 +00:00
Guy Harris 9e6329860a Fix some warnings - declare some arguments, variables, and structure
members to be const pointers when that's possible, and throw in some
casts when the GLib API fails to have properly consted arguments.

Use ep_strdup_printf() in some cases.

svn path=/trunk/; revision=25596
2008-06-25 03:05:19 +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
Bill Meier 2078ed4a5f Fix one add'tl warning as reported by David Kirkby
svn path=/trunk/; revision=24298
2008-02-11 01:41:49 +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
Anders Broman b603b47759 From Stefano Picerno:
Makes more fields searchable
Also fixes some typos and indentation errors
Fixes bug http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1802 for edonkey
dissector: every field defined by the dissector is now contained under the
PROTOABBREV=edonkey "root" key

svn path=/trunk/; revision=23315
2007-10-31 07:47:47 +00:00
Anders Broman 135ba5aeff From Stefano Picerno:
I made some updates to the edonkey dissector.
Most kademlia1 and some kademlia2 messages are now completely decoded.

svn path=/trunk/; revision=23288
2007-10-27 15:28:35 +00:00
Anders Broman 1950ffc214 Apply the small performance enhancment patches for:
- if offset is 0, tvb_length is the same as tvb_length_remaining, just faster.
Replace 
- col_append_fstr() with faster  col_append_str() 
- col_add_str() with col_set_str()
when it's safe

svn path=/trunk/; revision=23252
2007-10-23 05:50:00 +00:00
Jaap Keuter 71db7e37ac From Lukazs M.:
Small patch for packet-edonkey.c (stupid mistakes are the easiest to made :-))

svn path=/trunk/; revision=22192
2007-06-25 20:47:45 +00:00
Jaap Keuter d613ff0e2c From Lukasz M.:
Sometimes edonkey packets comes joined, and wireshark display only last
one on column Info. Now everyone is displayed.

svn path=/trunk/; revision=22143
2007-06-20 17:17:25 +00:00
Jaap Keuter d8200256a6 From Lukasz "M.":
I added 5 new packets to packet-edonkey.c and improve 2. Diffs in
attachment. This part of wireshark (decoding emule packets) it's not
finish as I see  :)  I try to do it, meybe...  :)

svn path=/trunk/; revision=22128
2007-06-18 18:11:58 +00:00
Guy Harris 5a43799a17 Use G_GINT64_MODIFIER, rather than the PRI[douxX]64 macros, for GLib
routines and routines using those routines.  GLib might use different
modifiers for 64-bit quantities than the platform's C library does.

svn path=/trunk/; revision=21990
2007-05-29 18:52:42 +00:00
Jeff Morriss ab97c31bb2 Fix warnings of the form "long long unsigned int format, guint64 arg": use
the PRI macros instead of %llu, etc.

svn path=/trunk/; revision=21454
2007-04-17 10:11:41 +00:00