Commit Graph

55 Commits

Author SHA1 Message Date
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
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 6bde918078 From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48426
2013-03-19 20:00:52 +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
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
Jakub Zawadzki 5a8783f5b1 Initial commit to support yet another method of passing data between dissectors.
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL

svn path=/trunk/; revision=44860
2012-09-10 21:40:21 +00:00
Guy Harris 754711b757 Fix a non-proto_tree_add_item() passing an ENC_ value as the last
argument.

svn path=/trunk/; revision=43798
2012-07-18 22:59:54 +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 ca3e8b5d8b 'tab-width/tabstop/tabSize' in editor modelines should really always be 8;
Also: In some cases do some whitespace cleanup and some minor reformatting.

svn path=/trunk/; revision=41724
2012-03-21 18:20:44 +00:00
Alexis La Goutte 92896f46b8 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=41312
2012-03-02 11:07:50 +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 13f39288a0 Fix a bug wherein proto_tree_add_uint() was intended instead of proto_tree_add_item();
This bug would have caused display of a FT_UINT32 field with the wrong endianness.
(Replaces change made in SVN #39350).


svn path=/trunk/; revision=39360
2011-10-11 15:11:51 +00:00
Bill Meier 232629191b Fix bugs which caused certain fields to display with the wrong endianness;
Specifically: some proto_tree_add_item() 'encoding' args were incorrect.

svn path=/trunk/; revision=39350
2011-10-10 23:34:24 +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
Anders Broman 4b952c1324 Get rid of check_col, while at it set ENC.
svn path=/trunk/; revision=39146
2011-09-26 08:25:18 +00:00
Bill Meier 781129806f Fix ex "modeline" so it works;
See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5748

svn path=/trunk/; revision=39081
2011-09-21 17:49:11 +00:00
Bill Meier 5c778feb6b From Yaniv Kaul:
Some fixes for 'set but not used' errors that GCC 4.6 emits.
From me:
  #include <string.h> not req'd.


svn path=/trunk/; revision=36907
2011-04-27 17:22:20 +00:00
Stephen Fisher 06c5cfc945 From Georg Mueller via bug #5851: Add not handled IDs to BitTorrent
dissector


svn path=/trunk/; revision=36726
2011-04-19 21:31:02 +00:00
Bill Meier af30978c39 Fix minor bug lookups of certain "peer ids" would fail.
The  issue (in essence)
 For:
  char foo[][4] = {"abc", "defg", "hij"};

strlen(foo[1]) will be 7 and not 4 as expected;

Detected via msvc level 4 warning: "array is too small to include a terminating null character"

svn path=/trunk/; revision=35732
2011-01-31 21:23:35 +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 b4410bc917 Use find_or_create_conversation() rather than only conversation_new().
Fixes bug #2907: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2907

svn path=/trunk/; revision=33136
2010-06-07 16:32:21 +00:00
Bill Meier 0fc9115705 Use consistent indentation; Whitesapce & formatting cleanup.
svn path=/trunk/; revision=32755
2010-05-11 16:54:55 +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 440c3f9261 From Didier Gautheron:
check_col.diff
Remove redundant calls to check_col() if it guards only one columns function with one parameter after the column type.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4394

svn path=/trunk/; revision=31519
2010-01-13 20:32:01 +00:00
Stig Bjørlykke ebd71d6f84 Added more Peer ID Conventions.
svn path=/trunk/; revision=30980
2009-11-16 22:53:11 +00:00
Kovarththanan Rajaratnam 6110a96f68 Don't guard col_set_str (COL_INFO/COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29345
2009-08-09 07:59:51 +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 8611ec5f5e More size_t casts.
svn path=/trunk/; revision=27879
2009-03-29 12:07:30 +00:00
Bill Meier c544c20956 Fix various typos and spelling errors (mostly in text strings)
svn path=/trunk/; revision=27050
2008-12-18 19:08:49 +00:00
Bill Meier b52d95d591 #include <emem.h> not req'd
svn path=/trunk/; revision=26091
2008-08-26 01:28:50 +00:00
Jeff Morriss 19e29f228f Remove some dead (statement not reached) code (while trying to avoid any false control reaches end of non-void function warnings)
svn path=/trunk/; revision=25706
2008-07-11 18:56:03 +00:00
Anders Broman 6226035893 Apply yet another set of the optimization patches:
When offset parameter is 0 replace tvb_bytes_exist() with the faster tvb_length().

On the other hand 
	if (tvb_bytes_exist(tvb, 0, 20)
is more readable than
	if (tvb_length(tvb) >= 20

so only do it in heuristic function

svn path=/trunk/; revision=23412
2007-11-09 06:01:18 +00:00
Jeff Morriss 3dec62b85c - s/ntohs/g_ntohs
- s/ntohl/g_ntohl
- s/free/g_free
- Change some tvb_get_string()+g_free()'s into tvb_get_ephemeral_string()
- Change some tvb_fake_unicode()+g_free()'s into tvb_get_ephemeral_faked_unicode()
- Change some tvb_get_string() calls that were clearly memory leaks (like
  atoi(tvb_get_string(...))) into tvb_get_ephemeral_string()

svn path=/trunk/; revision=22515
2007-08-15 22:27:52 +00:00
Guy Harris 1bc049906a Add some GCC warnings to the standard set, and add some others to the
--enable-extra-gcc-checks set.

If we turn on -pedantic, try turning on -Wno-long-long as well, so that
it's not *so* pedantic that it rejects the 64-bit integral data types
that we explicitly require.

Constify a bunch of stuff, and make some other changes, to get rid of
warnings.

Clean up some indentation.

svn path=/trunk/; revision=21526
2007-04-23 10:59:26 +00:00
Stephen Fisher 8fd3ee0560 Remove almost all of the casts I committed recently and in place of
them, add -Wno-pointer-sign to CFLAGS when gcc will accept it.


svn path=/trunk/; revision=21253
2007-03-28 21:55:11 +00:00
Stephen Fisher 85a464c980 Fix a bunch of warnings, add svn:keywords Id and svn:eol-style native
to packet-iuup.c.
 

svn path=/trunk/; revision=21244
2007-03-28 07:06:39 +00:00
Stephen Fisher fa3af74ba7 Fix a warning in packet-bittorrent.c I didn't fix right the first time and try to get the Win32 buildbot going again in packet-ndmp.c.
svn path=/trunk/; revision=21238
2007-03-27 23:33:59 +00:00
Stephen Fisher ab8f589336 Fix about 100 simple to fix warnings from gcc 4.0 in epan/dissectors
svn path=/trunk/; revision=21233
2007-03-27 22:50:11 +00:00
Ronnie Sahlberg 2d1bb39121 change the signature for the get_pdu_len() function pointer passed to tcp_dissect_pdus() to also include a packet_info pointer.
there are many reasons why some protocols actually need to be able to access the pinfo structure while determining the pdu size



svn path=/trunk/; revision=19751
2006-10-31 09:29:07 +00:00
Ronnie Sahlberg feab79e328 change a whole bunch of ethereal into wireshark
svn path=/trunk/; revision=18196
2006-05-21 04:49:01 +00:00
Ronnie Sahlberg f331077a60 waste a couple of bytes per tcp conversation and make the tree for acked_packets (i.e. packets that have interesting tcp properties such as being retransmissions etc) hang off the per conversation tcpd struct instead of being global.
while this should improve performance by unmeasurably little it does have the sideeffect that once we finish the rewrite   tcp analysis might actually work and work well even for tcp over tcp tunnelling. 

this also means that if you include packet-tcp.h   you also need to include emem.h .




svn path=/trunk/; revision=17681
2006-03-20 10:52:53 +00:00
Anders Broman 185cfdefd4 From John Sullivan:
Three patches here:

eth-ed-2.diff
-------------

1) The handling of HashSet Answer messages was wrong
2) Add dissection of some more eMule extension packets to do with
   error recovery

   
eth-bt-1.diff
-------------

New versions of the Azureus BitTorrent client implement a new extension to the protocol, which is effectively a text based encapsulation of the binary BitTorrent protocol, embedded within the BitTorrent protocol. Who knows why they thought that was a good idea, but this patch can pick apart their new headers.


eth-bt-2.diff
-------------

By registering a normal dissector as well as the heuristic one, BitTorrent shows up on the Decode As... list so you can manually override its mistake.

svn path=/trunk/; revision=16856
2005-12-19 06:48:07 +00:00
Ulf Lamping 6b3cacb197 bugfix: don't crash, if not enough bytes of the header available
svn path=/trunk/; revision=16124
2005-10-05 06:37:35 +00:00
Ulf Lamping e11c4aac89 enhancements COL_INFO output and make bittorrent protocol filterable
svn path=/trunk/; revision=16067
2005-10-02 15:41:11 +00:00
Guy Harris 2831a51832 The length returned for continuation data should be the length remaining
in the tvbuff starting at the specified offset, not the entire length of
the tvbuff.

svn path=/trunk/; revision=15401
2005-08-18 07:09:43 +00:00
Guy Harris 27a04a5255 Show BitTorrent stuff that doesn't look right as continuation data.
svn path=/trunk/; revision=15399
2005-08-18 01:17:46 +00:00
Gerald Combs 27728e30e5 If we receive junk data from the network it means we have a
malformed packet.  It doesn't necessarily mean that we have a problem
with our dissector.  If we see something we didn't expect, throw a
ReportedBoundsError instead of calling DISSECTOR_ASSERT() (which makes
BuildBot open a ticket).

Fixes bugs 362 - 366.


svn path=/trunk/; revision=15390
2005-08-17 15:04:44 +00:00
Guy Harris 3b6b4817e1 From Peter Johansson: add an option to decode the client information,
and check the validity of messages a bit more carefully.

Reformat a bit so not as much code is missed by those of us who like
narrow editor windows.

svn path=/trunk/; revision=15369
2005-08-16 05:58:50 +00:00
Guy Harris a05302b67a Find the BitTorrent dissector immediately after registering it, and save
the handle, rather than finding it every time we need it.

Just make a guint8 array with the BitTorrent magic string length
followed by the string, and use "tvb_memeql()" to test against that - it
handles checking to make sure there's enough data in the tvbuff (if
not, it returns -1 as a "no match" indication) and then checks all of
the first 20 bytes in one operation.

Clean up white space.

svn path=/trunk/; revision=14882
2005-07-09 00:44:44 +00:00