Commit Graph

57 Commits

Author SHA1 Message Date
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
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
Jeff Morriss fae881dc45 Put register_dissector() call back in
svn path=/trunk/; revision=22359
2007-07-19 15:11:34 +00:00
Stephen Fisher d1357063ae From Jess Balint:
a patch to fix the state management for the MySQL protocol dissector.


svn path=/trunk/; revision=22339
2007-07-17 21:50:29 +00:00
Stephen Fisher c053b3c769 From Martin Warnes:
Attached is a small patch that adds a preference option to allow the SQL
Query string to be appended to the INFO column display. This makes life
a little bit easier when scanning a trace to find the packet associated
with a specific query. I thought it was better to implement it as a
preference option with default set FALSE as it can clutter up the
display for applications that generate large amounts of queries.

svn path=/trunk/; revision=22130
2007-06-18 19:08:59 +00:00
Stephen Fisher 9c24cd4036 From Martin Warnes:
Currently the MySQL dissector assumes that an OK-Packet Response
contains the Server_Status field. Having checked the MySQL protocol page
I can't say conclusively whether it should or it shouldn't, however I've
come across a couple of MySQL Java clients that receive the OK-Packet
without the Server_Status field set in response to a "SET AUTOCOMMIT" call.
 
The attached patched simply adds a check to ensure the Server_Status
field is present before calling function mysql_dissect_server_status.


svn path=/trunk/; revision=22129
2007-06-18 18:57:58 +00:00
Jaap Keuter dc0d48928a From Martin Warnesi:
Attached updated patch to use "dissect_mysql_pdu" instead of
"dissect_mysql" when registering the protocol dissector.

svn path=/trunk/; revision=20021
2006-11-30 07:15:17 +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
Anders Broman f47dfde23a Remove leftover(?) plugin code.
svn path=/trunk/; revision=18761
2006-07-18 21:16:02 +00:00
Ronnie Sahlberg 847090fe54 fix coverity 188
at the same time, get rid of some unused parameter compiler warnings


svn path=/trunk/; revision=18493
2006-06-17 10:47:10 +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
Anders Broman 8d6661b911 From Axel Schwenke:
- complete dissector for greeting/login packets
- nearly complete dissector for requests, except:
  + parameters for COM_EXECUTE
  + requests from replication slave
- added some features to response dissectors

svn path=/trunk/; revision=18174
2006-05-16 19:07:48 +00:00