Commit Graph

84 Commits

Author SHA1 Message Date
Hadriel Kaplan ceb8d954d2 Lua: Expose tcp_dissect_pdus() to Lua
Provide a way for Lua-based dissectors to invoke tcp_dissect_pdus()
to make TCP-based dissection easier.

Bug: 9851
Change-Id: I91630ebf1f1fc1964118b6750cc34238e18a8ad3
Reviewed-on: https://code.wireshark.org/review/6778
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-01-27 15:14:12 +00:00
Petr Gotthard cce3ad281e Correctly dissect the AMQP 0-9 heartbeat frames. The heartbeat frames were
incorrectly highlighted as erroneous.

Change-Id: I94f8ef73e2432543ae3965da3789f27e872951ea
Reviewed-on: https://code.wireshark.org/review/6685
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-23 13:15:56 +00:00
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
Bill Meier c44ff776c4 amqp: Misc changes;
- amqp_1_0_dissectiom: Use MIN(32-bit-length, 0xFFFF) as the length to dissect;
  The original code just used the low-order 16 bits of the 32-bit length
  field  as the length to dissect.
  Add an expert warning if the actual PDU length is > 65K.

- tvb_length() --> tvb_reported_length()

Change-Id: I3230600f460a8bd495eeec17fa6e704bf24de1a2
Reviewed-on: https://code.wireshark.org/review/5225
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-10 20:15:51 +00:00
Guy Harris 3428e809dd Don't forward-declare amqp_0_10_get_size_field(), as it no longer exists.
Change-Id: I796826bafd0768b610c9afbde8407fd9d3cc775e
Reviewed-on: https://code.wireshark.org/review/5180
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-07 23:17:26 +00:00
Bill Meier 8f62bb7cce amqp: handle potential overflows when dissecting amqp_0_10 PDUs;
Bug: 10582
Change-Id: I2fbb16b9d641dfe872aed468f8b944f7ef274261
Reviewed-on: https://code.wireshark.org/review/5176
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-07 21:53:58 +00:00
Bill Meier 9ac261f205 amqp: Fix a number of bugs in dissect_amqp_0_10_map().
(Among other things: "2 ^ xxx" is *not* 2 to the xxx'th power).

Change-Id: I893b72e853ecbb5d7e6259e950fb347e89eed6c2
Reviewed-on: https://code.wireshark.org/review/5109
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-04 16:22:37 +00:00
Bill Meier 8def8ef9c4 packet-amqp.c: Temporary/preliminary fix for Bug #10582 (crash)
This is a temporary/preliminary fix to prevent the buildbot fuzz-test
 failures seen when testing the capture file attached to Bug #10582.

As noted in the bug, a complete fix will require some reworking of
  the amqp dissector.

Change-Id: I2571f1eeb46a7eede04b8d809e87b95f1ff529df
Reviewed-on: https://code.wireshark.org/review/4835
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-19 14:14:22 +00:00
Bill Meier 10406870f5 Add editor modelines; fix indentation as needed.
Change-Id: I1ad94654343e5a018a0b3159481d45ffb3a91263
Reviewed-on: https://code.wireshark.org/review/4363
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-29 13:47:02 +00:00
Michael Mann 3fa5625ea0 Eliminate proto_tree_add_text from some dissectors.
Change-Id: Ib6024307e85d6c23decf40e9759f549c19ffe136
Reviewed-on: https://code.wireshark.org/review/3318
Petri-Dish: Michael Mann <mmann78@netscape.net>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-03 16:29:16 +00:00
Michael Mann 188aa9a80e convert to proto_tree_add_subtree[_format]
Change-Id: Ib60ca75b7da8cfa21cfe2999c9b9448a02c332df
Reviewed-on: https://code.wireshark.org/review/2560
Tested-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22 21:07:16 +00:00
Michael Mann b98dc77cde Cleanup filter fields that checkdisplayfilter.pl was complaining about.
Cleaned up filter names that were shared, but had different types (which can cause problems in a display filter compare)

Also cleaned up many [FIELDDESCR] that effectively mimicked the field name.  Even more could probably be done (and/or rename field name to be more descriptive), but I was being conservative.

Change-Id: I2e072b4f411c390b9430a0a0d903133d6decae5e
Reviewed-on: https://code.wireshark.org/review/2448
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-19 22:18:35 +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
Pavel Moravec d84b683bac Add AMQP listening port option to preferences
Change-Id: Ief46b7b53ddecd649e54d3c23a3504c4165c812f
Reviewed-on: https://code.wireshark.org/review/1855
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-30 20:01:00 +00:00
Pascal Quantin bc15fad105 AMQP: always display its name in protocol column, whatever the protocol version
Bug: 10101
Change-Id: I41105b250384bd44c37c0707ad41c9d76700bc75
Reviewed-on: https://code.wireshark.org/review/1641
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-14 18:53:03 +00:00
AndersBroman ce527ba58d Try to fix trivial varnings
Change-Id: I7b09999fe34ffded73f0b26c3e561b39d2120643
Reviewed-on: https://code.wireshark.org/review/714
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-17 15:57:55 +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
Evan Huus dab27680cd From Pavel Moravec via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9612
Fix possibly-uninitialized variable caught by valgrind fuzzing in AMQP.

svn path=/trunk/; revision=54981
2014-01-27 13:42:34 +00:00
Evan Huus 893b1aa3cd Remove duplicate #include.
svn path=/trunk/; revision=54928
2014-01-23 13:39:39 +00:00
Guy Harris 222296999b Use tvb_get_string_enc() with appropriate encodings rather than
tvb_get_string().  (Some versions of the spec speak of ISO 8859-15
strings as well as UTF-8 strings, but we don't appear to try to handle
those.)

Update spec URL.

svn path=/trunk/; revision=54910
2014-01-22 20:51:56 +00:00
Alexis La Goutte a3fee176d4 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
svn path=/trunk/; revision=54902
2014-01-22 07:49:48 +00:00
Guy Harris 1d27123ab1 Longs are not guaranteed to be 64-bit. Use G_GINT64_MODIFIER to format
64-bit quantities.

svn path=/trunk/; revision=54863
2014-01-20 21:37:32 +00:00
Evan Huus 77e4a2f09c Fix 32/64 casting and add a note where the loss of precision might actually be a
problem for 32-bit platforms.

svn path=/trunk/; revision=54858
2014-01-20 19:32:43 +00:00
Evan Huus f5931c7559 From Pavel Moravec via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9612
AMQP 1.0 Dissector

svn path=/trunk/; revision=54857
2014-01-20 19:13:42 +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 ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Michael Mann 8081cf1d90 Add data parameter to tcp_dissect_pdus() as well as convert it to using "new" style dissectors.
Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that?

Should tcp_dissect_pdus return length (bytes consumed)?  There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb).  Seems like that could all be rolled into one.

svn path=/trunk/; revision=53198
2013-11-09 17:46:28 +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 efe18f199c Convert a few dissectors from emem to wmem API
svn path=/trunk/; revision=51983
2013-09-12 20:37:30 +00:00
Michael Mann 9e3f9b449f expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51852
2013-09-09 00:44:09 +00:00
Michael Mann e597acdc48 Batch of filterable expert info.
svn path=/trunk/; revision=51625
2013-09-01 13:05:27 +00:00
Michael Mann 30c5457f71 Convert proto_item_set_expert_flags into something filterable.
svn path=/trunk/; revision=51135
2013-08-04 13:08:59 +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 1823aa007c it's ==> its & its ==> it's as needed.
svn path=/trunk/; revision=47891
2013-02-26 01:06:19 +00:00
Evan Huus 0fa191245e Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8337
Make offset unsigned and add an additional sanity check.

svn path=/trunk/; revision=47681
2013-02-15 20:58:59 +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
Bill Meier 65384d0091 General cleanup:
- Don't call col...() & expert...() under 'if (tree)';
- Localize some variables; Remove uneeded initializers;
- Remove incorret _U_ from certain function parameters;
- Reformat long-lines; Do whitespace changes;
- Misc.


svn path=/trunk/; revision=46444
2012-12-07 16:25:56 +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 c02d156881 The amqp dissector is not a plugin; remove comment indicating that it's a plugin.
Also: Fix some "4 space tab" indentation (replace with spaces).

svn path=/trunk/; revision=43566
2012-07-04 13:04:16 +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 ffb49b9561 From Matt Dainty:
Add array datatype parsing to AMQP dissector.

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

svn path=/trunk/; revision=40879
2012-02-06 17:27:36 +00:00
Anders Broman 62866c78a0 Get rid of Warnings.
svn path=/trunk/; revision=39957
2011-11-20 12:43:04 +00:00
Anders Broman 42b44648c8 Get rid of Warnings.
svn path=/trunk/; revision=39954
2011-11-20 08:59:19 +00:00
Alexis La Goutte d9623925e8 Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=39606
2011-10-26 18:00:54 +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 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