Commit Graph

34 Commits

Author SHA1 Message Date
Michael Mann 64a7bac641 tvb_bytes_to_ep_str -> tvb_bytes_to_str
Change-Id: I79c613cbdd8dc939dd4c29ebc477fb6eefd5bfc4
Reviewed-on: https://code.wireshark.org/review/6371
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-07 18:16:23 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +00:00
Guy Harris ce3d2ff3de Rename dissector_add_handle() to dissector_add_for_decode_as().
Hopefully that name makes it clear what the routiner's purpose is, and
will encourage people to use it rather than using dissector_add_uint()
with a bogus integer value.

Change-Id: Ic5be456d0ad40b176aab01712ab7b13aed5de2a8
Reviewed-on: https://code.wireshark.org/review/2483
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 16:43:56 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +00:00
Dario Lombardo 971ffd683e Fixup: tvb_get_string(z) -> tvb_get_string(z)_enc
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe
Reviewed-on: https://code.wireshark.org/review/2376
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:13:58 +00:00
Bill Meier 348c19cc7d Use try_val_to_str() in heuristics test (intead of a loop); ensure no exception during test.
Change-Id: Ib55ccca4a025fb1cbef52ffa01888fef6d72156a
Reviewed-on: https://code.wireshark.org/review/651
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-03-14 17:11:17 +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
Guy Harris 6a9b99cf98 And more constification.
svn path=/trunk/; revision=54759
2014-01-14 04:01:34 +00:00
Guy Harris ccbebb0ee3 More constification.
svn path=/trunk/; revision=54758
2014-01-14 03:56:36 +00:00
Guy Harris 60f06e558a Don't cast away constness when you don't have to.
svn path=/trunk/; revision=54756
2014-01-14 03:16:27 +00:00
Jakub Zawadzki deb2b236f2 Add missing includes
svn path=/trunk/; revision=54332
2013-12-21 17:23:17 +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
Jakub Zawadzki c45475ab45 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54135
2013-12-15 23:44:12 +00:00
Jakub Zawadzki 65db82872c When including <epan/prefs.h> don't force inclusion of <epan/uat.h>
svn path=/trunk/; revision=53769
2013-12-03 22:16:49 +00:00
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
Pascal Quantin 6cedc2c336 Convert a few more dissectors to wmem
svn path=/trunk/; revision=51991
2013-09-12 22:03:31 +00:00
Jeff Morriss effa86350a From Chen Li via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8949 :
Fix the dissection of the port number in announce_peers request in BTDHT.

svn path=/trunk/; revision=50899
2013-07-26 00:24:54 +00:00
Martin Kaiser 9475131092 From chen li
handle list ending delimiter in bt-dth peer list

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

svn path=/trunk/; revision=49729
2013-06-03 21:01:43 +00:00
Alexis La Goutte 579deaa7b9 Enhance BT-DHT Dissector * Use proto_tree_add_item * Enhance display list (nodes, peers...) * Remove ununeed space * ...
svn path=/trunk/; revision=48941
2013-04-20 09:49:00 +00:00
Alexis La Goutte 55c415b477 Fix Modelines (No CR in the end of file)
svn path=/trunk/; revision=48851
2013-04-15 08:43:04 +00:00
Alexis La Goutte 05e954f48c From report of chen li via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8572 Endian error and IP:Port error when decoding BT-DHT response message
When the remote client sended a node set, it contains nodes info
The node info it shows like (1	3cad1f360cc51870d3e68d61ed604078bc608ee2 60.173.31.54:43365), but this node's true ip and port is 99.192.73.131:26025. When we expand these items, the ips and ports in detailed information are right.

From me :
It is a problem of encoding (LITTLE ENDIAN => BIG ENDIAN) and wrong offset
Some issue with Peers info

svn path=/trunk/; revision=48850
2013-04-15 08:42:12 +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 ca4bb77022 From Patrik Lundquist:
Improvements to BitTorrent DHT dissector

Fixed filtering on protocol "bt-dht".

Improved heuristics. Can probably be enabled by default now (but I'll let someone else make that decision).

Unexpected IP address (first packet in capture file) and binary "tokens" (packet 17) were incorrectly printed as UTF-8 strings.

Moved duplicate code into bencoded_string_length().

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

svn path=/trunk/; revision=46396
2012-12-05 09:27:58 +00:00
Jeff Morriss 49466f95bc Introduce, and start using, TVB_SET_ADDRESS() and TVB_SET_ADDRESS_HF(). They
are like the non-TVB versions except that they take a TVB and an offset
instead of (frequently) a pointer into the TVB.

Calling tvb_get_ptr() before modifying the rest of the fields should help fix
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7960 (though I can't
reproduce that problem).


Replace a bunch of calls like:

SET_ADDRESS(..., AT_XXX, length, tvb_get_ptr(tvb, offset, length));

with:

TVB_SET_ADDRESS(..., AT_XXX, tvb, offset, length);

svn path=/trunk/; revision=46324
2012-12-02 04:49:13 +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
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
Anders Broman 2a30b1eff9 Get rid of a couple of warnings.
svn path=/trunk/; revision=43065
2012-06-04 13:21:44 +00:00
Bill Meier 1311f29800 Fix Fix "bt-dht [..] NOT registered properly" as reported in Bug #6571.
"bt-dht [...] should also be common dissectors while not only heuristic
ones. So we can use them with 'Decode As...' command."

Essentially:
 -Register dissector handle so the dissector can be accessed via "decode-as".

From me:
   1. Given that the current heuristic is much too weak and
      causes 'false positives':
        Add a preference to allow enabling/disabling of heuristic dissection.

      The default is 'disabled' since the current heuristic is quite weak.
      (For example: The heuristic incorrectly dissects about 40
       files in menagerie/public as being the BT-DHT protocol).
      Note: only heuristic dissection is disabled; 'decode-as' remains
            enabled.

Also:

1. Fix some bugs wherein bytes in the hex pane were not highlighted
   when a field was selected in the details pane.
2. Do some minor re-formatting of the source code.


svn path=/trunk/; revision=40603
2012-01-20 03:24:05 +00:00
Chris Maynard 5debb5c5e3 Fix memory leaks involving tvb_get_string[z]().
svn path=/trunk/; revision=40312
2011-12-28 16:36:57 +00:00
Bill Meier 36be9da221 Remove unneeded #includes;
Move proto_reg_handoff...() to the end of the file as per convention.

svn path=/trunk/; revision=39860
2011-11-15 19:00:08 +00:00
Alexis La Goutte 2fb7b4fc4c From Xiao Xiangquan via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5767
BitTorrent DHT dissector for wireshark

From me :
* Fix encoding attribut for proto_tree_add_item (with fix-encodings-args script)

svn path=/trunk/; revision=39653
2011-10-28 14:50:13 +00:00