Commit Graph

52 Commits

Author SHA1 Message Date
Jeff Morriss cc6fc23812 From Didier via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3055 :
Apply rev 25869 to most of the rest of the TCP-desegmenting dissectors.
(The SSL dissector was already updated in one of two spots with bug 4535/rev
32456.)

A couple of the patches had to be manually applied.

From me: Fix the comments to match the change (including in the TCP and SSL
dissectors.)

svn path=/trunk/; revision=36332
2011-03-25 19:02:18 +00:00
Stig Bjørlykke 84bc28bd6a Introduce "Fragment count" filter element for all protocols doing reassembly.
svn path=/trunk/; revision=35705
2011-01-30 21:01:07 +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
Jeff Morriss cce1bef672 Based on https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5391#c11 : put some DISSECTOR_ASSERTs and THROW's back in.
svn path=/trunk/; revision=35014
2010-11-23 15:27:18 +00:00
Jeff Morriss 1b04b1b765 From Emil Wojak via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5391 :
I'd like to share my enhancements to the TDS dissector with everyone.
The list of improvements follows:
- nearly complete dissection of RPC calls,
- detection and dissection of the ALL_HEADERS rule,
- corrected some existing proto_tree fields to support filters,
- other minor fixes where the interpretation of data conflicted with the
  official documentation from MS.

I tested the new code on a variety of different TDS captures with many diverse
RPC calls. The code compiles and works on 32-bit Linux, I didn't check those
changes on other platforms though.

From me:

- terminate all value_strings
- change ++*offset to *offset += 1 (I think that's more readable)
- replace all the dissector assertions which could be caused by malformed
  packets with expert infos
- Don't throw ReportedBoundsError when the packets have unexpected data in
  them, just report an expert info and continue on

svn path=/trunk/; revision=35007
2010-11-22 18:48:54 +00:00
Bill Meier 209109c2fd Define some fcns & vars as static ...
svn path=/trunk/; revision=34458
2010-10-10 20:07:06 +00:00
Jeff Morriss 33f116a46d Restore pinfo->private_data after an exception was thrown by a subdissector.
This is necessary in case a subdissector had changed it but was unable to
restore it (due to the exception).

Remove check_col().

svn path=/trunk/; revision=34436
2010-10-08 17:48:22 +00:00
Jeff Morriss 0ff5638f37 Replace blurbs that match the name (case insensitive) with NULL.
svn path=/trunk/; revision=34227
2010-09-23 21:46:31 +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 10ffd14b8f Indentation & whitespace cleanup (including: "4 space tabs" ==> spaces)
svn path=/trunk/; revision=32735
2010-05-10 15:54:57 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Stig Bjørlykke 47e732e29e Changed "reassembled_length" -> "reassembled.length".
svn path=/trunk/; revision=31776
2010-02-03 08:47:15 +00:00
Stig Bjørlykke 88b72356ad Introduce "Reassembled length" filter element for all protocols doing
reassembly.

svn path=/trunk/; revision=31767
2010-02-02 16:01:52 +00:00
Bill Meier 73eb16d678 Fix some gcc -Wshadow warnings
svn path=/trunk/; revision=31623
2010-01-22 17:41:47 +00:00
Kovarththanan Rajaratnam 00810ff199 * Prefer col_append_str instead of col_append_fstr for constant strings
* Remove check_col guards

svn path=/trunk/; revision=30127
2009-09-24 20:21:23 +00:00
Kovarththanan Rajaratnam 8b515e9340 Switch a bunch of dissectors over to using tvb_new_subset_remaining()
svn path=/trunk/; revision=29446
2009-08-16 12:36:22 +00:00
Kovarththanan Rajaratnam e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +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
Gerald Combs 16dac84760 Remove some no-longer-needed casts.
svn path=/trunk/; revision=28081
2009-04-17 22:07:50 +00:00
Anders Broman 8e7599022d More size_t casts.
svn path=/trunk/; revision=27882
2009-03-29 14:37:57 +00:00
Bill Meier d6a5a7c761 P64 changes: Fix some cases for which size_t is not required
svn path=/trunk/; revision=27822
2009-03-22 20:55:31 +00:00
Stig Bjørlykke 9a0020f2f9 From Peter (bug 2942):
Allow optimalization with -ftracer.

svn path=/trunk/; revision=26822
2008-11-22 15:55:01 +00:00
Jaap Keuter 25cd2bc4d2 From Scott Roberts:
Patch to have the tds dissector register itself by name.

And fix the name of the register function itself.

svn path=/trunk/; revision=26474
2008-10-16 07:20:02 +00:00
Stig Bjørlykke c6af1bfdd4 Removed some "statement not reached" warnings.
svn path=/trunk/; revision=24282
2008-02-07 12:14:40 +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
Jörg Mayer 6bb9369681 "fix" some warnings about "might be used uninitialized" variables
svn path=/trunk/; revision=22983
2007-09-26 07:09:51 +00:00
Ronnie Sahlberg d5d5159b6d From Sebastien Tandel
fixes for various compiler warnings

svn path=/trunk/; revision=21210
2007-03-26 11:06:26 +00:00
Stephen Fisher 918ed4c03d Solution for enhancement "bug" #1254: "MSSQL / TDS parser should decode
passwords"


svn path=/trunk/; revision=20032
2006-12-02 01:08:16 +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 1f8782a66d From Bill Meier:
Fix bug 833 (remove 'dead' code flagged by Coverity); 
Update defines based upon current version of FreeTDS tds.h; Reformat defines for readability;

svn path=/trunk/; revision=18103
2006-05-07 18:39:47 +00:00
Gerald Combs efe2f4f563 Add more data types from tds.h. Fix unknown data skipping for some data
types. Fixup whitespace.

svn path=/trunk/; revision=16979
2006-01-09 17:44:02 +00:00
Ronnie Sahlberg 6657ebb4c9 remove some more sprintf
svn path=/trunk/; revision=15458
2005-08-20 02:51:13 +00:00
Ronnie Sahlberg 6411d20b50 the tds dissector were only using a GMemChunk as a simple way to prevent memleaks in case of an exception. (reset the gmemchunk at the start of each packet)
replace this gmemchunk with ep_alloc()


svn path=/trunk/; revision=15349
2005-08-14 01:41:55 +00:00
Ronnie Sahlberg b4441e6748 rename ep_tvb_fake_unicode() to tvb_get_ephemeral_faked_unicode() and update the README file.
svn path=/trunk/; revision=15271
2005-08-10 13:56:34 +00:00
Ronnie Sahlberg ec3ab9ec3e rename ep_tvb_get_string() to tvb_get_ephemeral_string() asnd update the documentation in README.developer
svn path=/trunk/; revision=15270
2005-08-10 13:41:13 +00:00
Jörg Mayer a0f94c125f Last set of trivial fixes for "no previous declaration" warnings.
svn path=/trunk/; revision=15191
2005-08-02 08:30:33 +00:00
Ronnie Sahlberg 69a6b59949 ememify the tvb_get_string() and tvb_fake_unicode() calls in tds
svn path=/trunk/; revision=15129
2005-07-28 09:20:56 +00:00
Lars Roland ec9ca01616 Move the following files from /trunk to /trunk/epan:
asn1.[ch]
follow.[ch]
ptvcursor.[ch]
reassemble.[ch]
xmlstub.[ch]

fix #include statements accordingly.

svn path=/trunk/; revision=13366
2005-02-09 23:38:00 +00:00
Anders Broman 851ecd2ac4 From Jon Ringle:
1) Added a setup_frame parameter to conversation_t
2) Used the conversation_t next to maintain a list of conversations with the 
same src/dest tuple but different setup_frame number.
3) Changed the signature of find_conversation() and conversation_new() to pass 
in the frame number.
4) Adjusted packet-sdp to select RTP conversation if both m=audio and m=image 
are present, and T.38 conversation if only m=image is present. I expect that 
RTP/T.38 dissecting to be better, but I don't have a way to generate T.38 
packets.

svn path=/trunk/; revision=13243
2005-02-02 20:07:03 +00:00
Ulf Lamping 78ff68d4b5 a lot of warnings removed, most of them about pointer to int casts without using the appropriate GLib macros
svn path=/trunk/; revision=12832
2004-12-25 13:49:30 +00:00
Gerald Combs c3a4d2b14f Add another token size check.
svn path=/trunk/; revision=12697
2004-12-09 16:37:46 +00:00
Gerald Combs c12298c668 Catch a couple of integer overflows.
svn path=/trunk/; revision=12641
2004-12-01 20:51:19 +00:00
Guy Harris f0bb45622b From Yaniv Kaul: the authentication token might be NTLMSSP or it might
be GSS-API.

svn path=/trunk/; revision=12589
2004-11-24 04:14:56 +00:00
Guy Harris 696a6dce64 Fix a spelling error.
svn path=/trunk/; revision=12575
2004-11-22 08:12:42 +00:00
Guy Harris 0271280470 Put the value of the length field in a variable-length token, not the
length of the token, into the protocol tree as the length value.

svn path=/trunk/; revision=12574
2004-11-22 08:11:31 +00:00
Guy Harris 4956f5fba1 From Bill Meier:
1. Add Preferences:

   a. To allow specification of a hint as to TDS protocol being decoded 
      (Unspecified/TDS4/TDS5/TDS7/TDS8); Default: 'unspecified'

      The 'hint' is used only when needed to do a correct decode.

      If the protocol is unspecified, the decode is as previous.

   b. To allow specification of 'ranges' of TCP ports to be treated as 
      'TDS tcp ports'; i.e. if the source or destination port of a tcp
      connection matches a specified range, then the connection should be
      considered to be TDS.

   c. To allow specification of a hint as to whether TDS being decoded is 
      'little-endian' or 'big-endian'. Default: 'little-endian'.

      A hint is just that; E.G. if TDS7+ packets are encountered the decode
      is always 'little-endian'.

2, Register tcp MS SQL default ports (1433, 2433) as TDS ports
   ('dissector_add'). This also enables TDS as a choice for 'decode as'.

3. 'netlib_check_login_pkt' changed to check 'TDS tcp port' range(s) as 
    entered in preferences;

4. Change 'dissect_tds_query_packet' to handle TDS4 ascii in addition to
   TDS7/8 UCS-16.

5. Change 'dissect_tds_rpc' to:

   a. handle TDS4 ascii RPC in addition to TDS7/8 UCS-16 RPC;
   b. handle Microsoft 'encoded' rpc_name;
   c. fix memory leak (not freeing memory obtained using
      'tvb_fake_unicode');

6. Change 'dissect_tds_response' to:

   a. handle tds4 tokens 'tds_col_name' and 'tds_col_info';
   b. dissect tokens 'tds_doneinproc' and tds 'doneproc' similarly to
      'tds_done'
   c. reclaim memory allocated for 'tds_col' structures when finished 
      processing response
           (Additional memory was being allocated each time a 
            tokenized tds5 response was processed)

7. New function 'dissect_tds_col_info_token' (similar to
   'read_results_tds5') associated with handling TDS4 responses.

8. New functions 'dissect_tds_query5_packet', 'dissect_tds5_lang_token'

9. Rework TDS token size calculation; Some TDS tokens have a length field
   of other than 2 bytes. (e.g.: the length field 
   for TDS_LANG_TOKEN is 4 bytes)

10. Update token definitions and usages;

   a. Update based upon info from current version of FreeTDS 'tds.h' 
      as well as info from Sybase TDS5 document;
      example: TDS_124_TOKEN renamed to TDS_PROCID_TOKEN

   b. TDS_124_TOKEN [TDS_PROCID] was incorrectly not considered 
      a 'fixed-size' token in function 'tds_is_fixed_token'

svn path=/trunk/; revision=12566
2004-11-21 22:03:33 +00:00
Guy Harris bbe7f89742 Move prefs.c and prefs.h into the epan subdirectory.
svn path=/trunk/; revision=12115
2004-09-27 22:55:15 +00:00
Ulf Lamping d530bd4e14 Prevent the word "desegmentation" at the GUI, but use reassembling at that places, as we also use "defragmentation" and "reassembling". Use reassembling as the general term for such actions.
I (hopefully) didn't changed any protocol fields or preference file names, but only the GUI labels appearing in the protocol display and the protocol preferences.

Also added a note to the protocol preferences (where appropriate), that you have to enable "Allow subdissectors to reassemble TCP streams" at the corresponding protocol settings for TCP reassembling to take effect.

If you encounter any mistakes I've made here, please let me know...

svn path=/trunk/; revision=11784
2004-08-21 09:02:52 +00:00
Guy Harris 5db0829d14 The FreeTDS documentation on TDS claims that the field after the locale
(or, as that documentation calls it, the language name) is the database
name; mark it as such.

It also says there's some other stuff, such as a client MAC address,
after the database offset/length (and that the NTLMSSP message doesn't
come right after the database offset/length, there's an offset/length
for the NTLMSSP message).  Put in a comment about that.

svn path=/trunk/; revision=11713
2004-08-10 22:45:47 +00:00
Guy Harris f1cfc2a9e3 From Yaniv Kaul:
1. define new TDS packet type (17) - NTLM authentication packet. Call
the ntlmssp dissector to dissect it when needed.
2. define new TDS packet type (18) - donno what it is exactly, but it's
there. Will dissect it someday.
3. heuristic in netlib_check_login_pkt should also check port 2433.
4. unify the dissection of msg and err token. They have the same
structure.
5. improve the dissection of the above mentioned token.

svn path=/trunk/; revision=11616
2004-08-06 20:12:20 +00:00