Commit Graph

68 Commits

Author SHA1 Message Date
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
Bill Meier 9874da2fcb #if 0 numerous "unused const variables" (mostly value-string-arrays);
Also; fix a few "set but not used" warnings.

svn path=/trunk/; revision=52780
2013-10-23 06:29:11 +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
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 17fbd9028a Batch of filterable expert info
svn path=/trunk/; revision=51823
2013-09-07 16:07:02 +00:00
Evan Huus 58804a6f15 Convert another 10 dissectors to wmem.
svn path=/trunk/; revision=51612
2013-08-31 14:32:01 +00:00
Michael Mann de68fd6eea Removed check_col() and the occasional tree.
svn path=/trunk/; revision=49938
2013-06-14 17:49:53 +00:00
Anders Broman 85a8e304dd Add the posibillity to use a key for per-packet-data.
svn path=/trunk/; revision=49259
2013-05-12 18:11:02 +00:00
Evan Huus b2f0991616 Catch overflow condition in mysql dissector.
Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8458

Also add modelines.

svn path=/trunk/; revision=48894
2013-04-17 15:38:35 +00:00
Anders Broman 55c498169d From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48400
2013-03-18 21:16:23 +00:00
Bill Meier 96a24cc79f Fix spelling/typos found using a list of commonly misspelled words.
The misspellings were mostly in comments but some were
in text strings visible to the user.


svn path=/trunk/; revision=47899
2013-02-26 04:42:26 +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
Bill Meier 7cd0417af5 Fix numerous instances of a variable/parameter name "shadowing" a library function name;
(At least some (gcc ?) compilers give a "shadow" warning for these).

svn path=/trunk/; revision=46402
2012-12-05 15:56:36 +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
Evan Huus 46a2eeecaf Add expert warning when we get a mysql EOF marker and the
connection is in a state where we're not expecting one.

svn path=/trunk/; revision=44731
2012-09-01 16:20:43 +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
Guy Harris 017c9eff05 Thou shalt not use proto_tree_add_string() with an FT_BYTES field.
svn path=/trunk/; revision=39873
2011-11-16 01:56:58 +00:00
Jeff Morriss db8bf387c8 From András Veres-Szentkirályi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6426 :
The current MySQL dissector ignored the execute parameters as metadata is
needed from previous packets to decode the fields. I added the necessary code
to store these in conn_data and developed dissector for all fields I could
reproduce on the network.

This also fixes a memory leak by moving the stmts structure (the pointer to
which is stored in se_allocated memory) into se_trees.

From me: use se_tree_create_non_persistent() so the entire tree is forgotten when
the se_ memory goes away.  Also some reformatting.

svn path=/trunk/; revision=39483
2011-10-20 01:55:04 +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 8cc93538e2 Whitespace cleanup.
svn path=/trunk/; revision=39189
2011-09-29 22:15:43 +00:00
Bill Meier 38a43987ab From András Veres-Szentkirályi: Added cursor type decoding to MySQL dissector
"The current MySQL dissector treats the exec_flags field as unused, however
since MySQL 5.0, this field is used to indicate the type of the cursor as it
can be read at
http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol#Execute_Packet_.28Tentative_Description.29


svn path=/trunk/; revision=39188
2011-09-29 21:47:01 +00:00
Bill Meier ad1efb6b9c (Trivial) Remove trailing whitespace from lines for a few files.
svn path=/trunk/; revision=39084
2011-09-21 23:42:55 +00:00
Anders Broman b1972828b8 From Pierre-Marie de Rodat:
MySQL’s response for a “prepare statement” command not supported by the MySQL dissector

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

svn path=/trunk/; revision=39018
2011-09-15 20:11:12 +00:00
Jeff Morriss 43f966a0ea From Alexis La Goutte via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5768 :
Patch 6 :
Enhance the MySQL collation

Patch 7 :
Enhance MySQL : add dissection of command Binlog Dump (replicate command).

svn path=/trunk/; revision=36433
2011-04-01 19:50:50 +00:00
Jeff Morriss 569c3d9014 From Alexis La Goutte via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5768 :
Patch 5

Enchance MySQL : 
* Add expert info of when undecoded data 
* Fix some white space

svn path=/trunk/; revision=36379
2011-03-28 15:20:16 +00:00
Jeff Morriss 01ec42762f From Alexis La Goutte via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5768 :
Patch 3 :
Enhance MySQL : Request/Response sub-dissector/function 
(white space changes, use ENC_NA when appropriate, use
proto_tree_add_item()...)

Patch 4 :
Enhance MySQL : packet_ok, server, capa sub-dissector/function (white space
changes, use ENC_NA when appropriate, use proto_tree_add_item()...)

Split mysql_dissect_caps in mysql_dissect_caps_client and
mysql_dissect_caps_server

Rename mysql_dissect_ext_caps to mysql_dissect_ext_caps_client

svn path=/trunk/; revision=36309
2011-03-24 15:31:52 +00:00
Jeff Morriss e7a6230eca From Alexis La Goutte via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5768 :
Patch 1 :
Enhance MySQL : Reorder hf and Proto_reg

Patch 2 :
Enhance MySQL : white space changes, use ENC_NA when appropriate, use
proto_tree_add_item()

svn path=/trunk/; revision=36296
2011-03-23 19:12:24 +00:00
Chris Maynard 1dd51f1e15 From Alexis La Goutte submitted in bug 5759: Use ENC_NA where appropriate.
From me:  Remove unused header fields found by checkhf.pl.  One more ENC_NA.

svn path=/trunk/; revision=36211
2011-03-18 20:02:45 +00:00
Chris Maynard 704838106e All fields are little-endian. Fixes bug 5759 reported by Tang Fulin.
svn path=/trunk/; revision=36210
2011-03-17 20:17:09 +00:00
Jeff Morriss 8d32d2066a There's no need to pass the result of tvb_get_ptr() as the 'value' in
proto_tree_add_*(): just use proto_tree_add_item().

Replace some tvb_get_ptr()s with tvb_get_ephemeral_string() or
tvb_get_const_stringz().

Use tvb_memeql() & tvb_memcmp().

svn path=/trunk/; revision=35558
2011-01-16 20:51:21 +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 03b57df5a0 Fix various typos and spelling errors.
svn path=/trunk/; revision=35126
2010-12-06 01:34:58 +00:00
Bill Meier affd5e0207 From Alexis La Goutte: MYSQL: Fix FIELD_PACKET dissection;
From me: Two additional fixes for FIELD_PACKET dissection;
         Revision of the original patch from Alexis to
          properly dissect a SHOW_FIELDS response message.

svn path=/trunk/; revision=34395
2010-10-06 14:59:19 +00:00
Anders Broman 9c824270f7 From Brandon Skari:
MySQL dissector doesn't dissect query responses.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5058

svn path=/trunk/; revision=33701
2010-08-03 16:25:13 +00:00
Jeff Morriss 729de1a635 As suggested in http://www.wireshark.org/lists/wireshark-dev/200809/msg00075.html
(as referenced in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2907 ) and
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3411 :

Write a new convenience routine for finding a conversation and, if it is not
found, create it.  The frame number and addresses are taken from pinfo (as is
the common case).

Use this function in a bunch of dissectors.

svn path=/trunk/; revision=32790
2010-05-13 18:28:34 +00:00
Bill Meier c5614625ee Fix some gcc -Wshadow warnings ....
svn path=/trunk/; revision=31559
2010-01-18 23:16:10 +00:00
Kovarththanan Rajaratnam 65c53fedb6 Don't guard col_append_str with check_col
svn path=/trunk/; revision=30125
2009-09-24 20:00:21 +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 4d8dd01e8e Changed flags_set_truth -> tfs_set_notset
svn path=/trunk/; revision=28989
2009-07-07 14:54:15 +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
Bill Meier 7172127412 #include reassemble.h not req'd
svn path=/trunk/; revision=27911
2009-03-31 12:08:44 +00:00
Jeff Morriss 8320827203 Fix conversation tracking bug noticed in:
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3216#c2

(Basically: how the dissector was dissecting frames--in the GUI--changed based
on the order you had clicked on them.)

... by rewriting how the frame states are maintained: rather than maintaining
a g_hash table of frames and their states, hang the (now se_alloc'd) frame
data off the frame (using p_*_proto_data()).

svn path=/trunk/; revision=27575
2009-03-01 21:37:30 +00:00
Jeff Morriss 6ce992885e From Toralf Forster via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3216 :
Implement mysql_dissect_row_packet().

From me: change all tvb_length_remaining() calls to
tvb_reported_length_remaining() so the dissector will throw an exception if
the packets are truncated.

svn path=/trunk/; revision=27568
2009-02-28 19:30:56 +00:00
Jeff Morriss 2a516cfe4d Remove a whole bunch of if(tree)'s that were protecting single
proto_tree_add_*() calls: those APIs check if tree is NULL too and taking
out the dissector's ifs makes the code easier to read.

svn path=/trunk/; revision=27567
2009-02-28 19:14:14 +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 3e347bb88c Minor cleanups related to proto_reg_handoff
svn path=/trunk/; revision=26277
2008-09-26 17:04:01 +00:00
Jeff Morriss a5ca07247b conv_frame_states is an array of pointers, make it a GPtrArray instead of a GArray with casts
svn path=/trunk/; revision=25754
2008-07-16 13:29:21 +00:00
Stig Bjørlykke 1d4deb0f19 From Jess Balint (bug 2700):
Implement field decoding in mysql protocol dissector.

svn path=/trunk/; revision=25728
2008-07-12 20:02:10 +00:00
Jeff Morriss 75849c12f1 s/%ll/%" G_GINT64_MODIFIER "/g
svn path=/trunk/; revision=24181
2008-01-24 21:57:13 +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