Commit Graph

93 Commits

Author SHA1 Message Date
Guy Harris cf91fdf16b Have tap listeners specify whether the "packet" routine requires
a protocol tree;

	the column values.

This includes stats-tree listeners.

Have the routines to build the packet list, and to retap packets, honor
those requirements.  This means that cf_retap_packets() no longer needs
an argument to specify whether to construct the column values or not, so
get rid of that argument.

This also means that there's no need for a tap to have a fake filter
to ensure that the protocol tree will be built, so don't set up a fake
"frame" filter.

While we're at it, clean up some cases where "no filter" was represented
as a null string rather than a null pointer.

Have a routine to return an indication of the number of tap listeners
with filters; use that rather than the global num_tap_filters.

Clean up some indentation and some gboolean vs. gint items.

svn path=/trunk/; revision=28645
2009-06-05 22:42:47 +00:00
Stig Bjørlykke fc3f1b5283 From Artem Tamazov (bug 3472):
Save/Restore pinfo->private_data when used.

svn path=/trunk/; revision=28412
2009-05-19 17:16:14 +00:00
Gerald Combs d797045341 From Abhik Sarkar via bug 3242:
Add a UAT for custom HTTP header fields.
  
From me:

  Use se_alloc0 to initialize a struct. Use g_strdup(...) instead of
  g_strdup_printf("%s"...). Add a missing UAT_END_FIELDS.

svn path=/trunk/; revision=28406
2009-05-19 00:17:23 +00:00
Anders Broman c91a384702 Apply some of the patches from:
http://wiki.wireshark.org/Development/Optimization

svn path=/trunk/; revision=28356
2009-05-13 19:46:11 +00:00
Gerald Combs ef0e74e533 More size_t casts.
svn path=/trunk/; revision=27897
2009-03-30 18:40:33 +00:00
Bill Meier c0e92cbc04 Fix various typos and spelling errors (mostly in text strings)
svn path=/trunk/; revision=27065
2008-12-20 00:09:02 +00:00
Gerald Combs 4948a597c4 Partial support for RFC 2324.
svn path=/trunk/; revision=26931
2008-12-08 18:01:13 +00:00
Jaap Keuter d6556ed5a2 Add the Content-Length header as a header string, while maintaining the content-length filter option.
svn path=/trunk/; revision=26522
2008-10-23 06:57:31 +00:00
Bill Meier ffa7320de2 Minor cleanup related to proto_register & proto_reg_handoff
svn path=/trunk/; revision=26280
2008-09-26 20:06:40 +00:00
Anders Broman 2b9d63a4b5 Move common code to base64.c
svn path=/trunk/; revision=25908
2008-08-03 14:27:22 +00:00
Jeff Morriss c50b4aec09 More (mostly stats tree) unsigned->signed char cleanup
svn path=/trunk/; revision=25717
2008-07-12 01:48:24 +00:00
Jeff Morriss 71c1e4faf0 Change the stats tree API to use signed chars instead of guint8s for all its
strings; this should fix a number of signed/unsigned char warnings.
Reindent a bunch, too.

svn path=/trunk/; revision=25716
2008-07-11 21:13:39 +00:00
Bill Meier 65bcd0d67f Display "Decompression failed" when appropriate (& Fix some src spacing)
svn path=/trunk/; revision=25681
2008-07-08 22:36:35 +00:00
Guy Harris d1275537c0 Get rid of #defines that are no longer being used (we now have a port
range list preference for HTTP, which we initialize to the default list).

svn path=/trunk/; revision=25667
2008-07-03 19:50:15 +00:00
Bill Meier 33af75a599 Fix some warnings reported by gcc -Wshadow ...
svn path=/trunk/; revision=25628
2008-06-28 21:09:57 +00:00
Bill Meier 9ca142b160 Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25282
2008-05-13 01:23:37 +00:00
Anders Broman 63c5c71cf8 Remove:
#ifdef NEED_G_ASCII_STRCASECMP_H
#include "g_ascii_strcasecmp.h"
#endif

svn path=/trunk/; revision=24859
2008-04-09 05:36:08 +00:00
Stephen Fisher 726a1caaf1 - Remove GLIB1 code
- Change ugly GLIB version checking statements to GLIB_CHECK_VERSION
- Remove ws_strsplit files because we no longer need to borrow GLIB2's
  g_strsplit code for the no longer supported GLIB1 builds


svn path=/trunk/; revision=24829
2008-04-07 05:22:54 +00:00
Jeff Morriss 0bb7de356a Fix http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=383 : show multiple (pipelined) HTTP packets in the Info column.
svn path=/trunk/; revision=24586
2008-03-08 21:17:43 +00:00
Jeff Morriss bb323055b2 match_strval() may return NULL so don't blindly pass its return value into col_add_*() or proto_add_*(); use val_to_str() (returning "Unknown (%d)" if no match is found) instead.
svn path=/trunk/; revision=24557
2008-03-04 21:05:21 +00:00
Sake Blok 9ad27ce239 Fix for bug 1586: When proxying a tcp connection (mostly used with ssl over an
http proxy), let the proxied protocol take care of reassembly itself.


svn path=/trunk/; revision=23949
2007-12-26 18:28:31 +00:00
Anders Broman 95d8c7e2da Apply yet another of the optimization patches:
- Only call functions if they are needed or once.

svn path=/trunk/; revision=23628
2007-11-27 21:24:39 +00:00
Guy Harris 9c89cdaaa3 strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delenda
est.  Use g_ascii_strcasecmp() and g_ascii_strncasecmp(), and supply our
own versions if they're missing from GLib (as is the case with GLib
1.x).

In the code to build the list of named fields for Diameter, don't use
g_strdown(); do our own g_ascii_-style upper-case to lower-case mapping
in the hash function and use g_ascii_strcasecmp() in the compare
function.

We do this because there is no guarantee that toupper(), tolower(), and
functions that use them will, for example, map between "I" and "i" in
all locales; in Turkish locales, for example, there are, in both
upper case and lower case, versions of "i" with and without a dot, and
the upper-case version of "i" is "I"-with-a-dot and the lower-case
version of "I" is "i"-without-a-dot.  This causes strings that should
match not to match.

This finishes fixing bug 2010 - an earlier checkin prevented the crash
(as there are other ways to produce the same crash, e.g. a bogus
dictionary.xml file), but didn't fix the case-insensitive string matching.

svn path=/trunk/; revision=23623
2007-11-27 18:52:51 +00:00
Gerald Combs 8e45bbf506 Don't call tvb_set_child_real_data_tvbuff() + add_new_data_source() twice
for the same tvb.  This keeps us from freeing the same memory twice and
crashing on some systems.

This might be the same bug Brian Vandenberg was looking for in
http://www.wireshark.org/lists/wireshark-dev/200705/msg00406.html .

svn path=/trunk/; revision=23415
2007-11-09 20:04:40 +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
Tomas Kukosa 652b2503c9 add missing initial registration to TCP and SSL ports
svn path=/trunk/; revision=22469
2007-08-08 14:01:28 +00:00
Tomas Kukosa e7a40dbb61 make TCP and SSL/TLS ports configurable for HTTP
svn path=/trunk/; revision=22322
2007-07-16 12:51:42 +00:00
Stephen Fisher c38acbae0e From Sake Blok:
While looking into the http-dissector I improved a few things on
how it dissects a proxy CONNECT session. This is what I have changed:

- added the fields hf_http_proxy_connect_host and -port

- changed proto_tree_add_text to proto_tree_add_string and -uint
  so that it's possible to filter on them

- make these two fields "PROTO_ITEM_SET_GENERATED"

- removed the alteration of the ports within pinfo, now the
  ports in the column info are not changed to the port used to
  connect to the backend server. It is now possible to use
  follow-tcp-stream again on proxied ssl sessions.


svn path=/trunk/; revision=21618
2007-04-28 23:52:12 +00:00
Jeff Morriss 59159fe03e Fix bug 1452: Don't pass a null pointer to g_strsplit().
svn path=/trunk/; revision=21165
2007-03-24 10:07:20 +00:00
Jörg Mayer a8f4da5ead Sebastien Tandel:
some warning fixes

packet-http.c
    set headers.content_length = 0 before the first potential use of it.
packet-kink.c
    "ifdef kerberos" around one function declaration
packet-nbns.c
    set headers.{dgm_length|pkt_offset|error_code} = 0
packet-pflog.c
    delete capture_pflog and
capture_old_pflog which aren't used anymore in the code.

svn path=/trunk/; revision=21120
2007-03-22 15:19:49 +00:00
Stephen Fisher 4eeb29a8a7 Fix bug #1394: Runtime error crash after clicking on HTTP packet
The capture file the user supplied had a HTTP chunked response
in it with no actual chunks other than the zero length chunk
indicating the end of the chunks.  The fix is to only create
a new_tvb and copy it over the tvb going into the
chunked_encoding_dissector() function if the chunk size is > 0.
 

svn path=/trunk/; revision=21034
2007-03-16 00:47:26 +00:00
Jörg Mayer a00dc2564e strncmp(NULL, ...) isn't such a good idea.
svn path=/trunk/; revision=21033
2007-03-14 22:58:09 +00:00
Stephen Fisher eeea95ccbe HTTP Export Object updates:
- Split the HTTP tap into two taps: one for the HTTP statistics
   and the other for the export object function.  This allows the
   HTTP statistics to work again (they seem to have been
   partially broken since SVN rev 18901).
 - Pass the conversation data (conv_data) between functions now
   instead of using the global variable stat_info (now only used
   for the HTTP stats)
 - Pass only pointers from the HTTP dissector to the Export Object
   tap, where we'll then copy the values and insert into the slist.
 - Make sure we free all memory allocated by this feature when
   we're done with it.
 - Various other minor improvements


svn path=/trunk/; revision=21021
2007-03-13 20:42:04 +00:00
Stephen Fisher 2865e52843 Export Object code/documentation updates:
- Note in the user's guide that export object is not available 
   in GTK1 builds of Wireshark.
 - Make scanning through the slists more efficient
 - Use new tap.c function called have_tap_listener() to only save
   object payload data when the export object listener is actively
   listening for it.
 - Save objects in the HTTP dissector with g_malloc() instead of
   se_malloc() and free it when we're done with it - when the
   export object window is closed (Fixes bug #1412)
 - Various minor improvements


svn path=/trunk/; revision=20980
2007-03-06 00:36:25 +00:00
Stephen Fisher 2c5ccc66ef Update object export code:
- Add to User's Guide
 - Add a help button
 - Move a lot of code into the shared export_object.c file and out of
   dissector specific file export_object_http.c.  This will make adding
   additional protocols much easier.
 - Change comment in packet-http.c to reflect new name (Export Object)
 - Various other minor improvements 


svn path=/trunk/; revision=20961
2007-03-03 03:14:00 +00:00
Stephen Fisher 7a2bfb7a61 Initial version of the new Statistics -> Content List -> HTTP feature. This
feature lists all of the content found in an HTTP stream (images, http, etc.)
and displays it in a list that allows the user to save each one as a file that
is already reassembled by the dissectors.


svn path=/trunk/; revision=20867
2007-02-19 22:37:45 +00:00
Stephen Fisher d4fffce05f Add comments to the statistics functions to tell which is which
svn path=/trunk/; revision=20852
2007-02-19 05:21:12 +00:00
Stephen Fisher 0ebc01dc03 From Sebastien Tandel:
Create two new files (ws_strsplit.[ch]) that use GTK2 code to override
the buggy g_strsplit() function when compiling for GTK1.  Include this
work-around function (ws_strsplit) in libwireshark.def.  Add notes on usage
to README.developer.  Include epan/ws_strsplit.h in all files that use
g_strsplit().


svn path=/trunk/; revision=20804
2007-02-13 20:57:22 +00:00
Stephen Fisher 2cca9d7f55 Fix for bug #646: show the end of HTTP chunked encoding (a chunk with size 0)
as described in RFC 2616.

-This line, and those below, will be ignored--

M    packet-http.c

svn path=/trunk/; revision=19968
2006-11-24 02:59:43 +00:00
Stephen Fisher 3193603d78 Fix problem reported on -dev list by Frank Maerz with Wireshark crashing
when it encountered a proxy http connect to port 80.  This was caused by
the dissector calling itself over and over.  Now if the connect to port is
one of the defined http ports, it calls the data dissector.


svn path=/trunk/; revision=19899
2006-11-15 06:46:11 +00:00
Ronnie Sahlberg 961ff01149 teach the http header dissector how to handle integer fields instead of just assuming everything is a string field
change http.content_length to be FT_UINT32


svn path=/trunk/; revision=19654
2006-10-21 22:17:43 +00:00
Ulf Lamping ee8abeec9e fix a typo
svn path=/trunk/; revision=19386
2006-09-30 18:30:43 +00:00
Ronnie Sahlberg b61e42bc3a from bryant eastham
Also, there is still an outstanding issue regarding the default use of
the "media" dissector. The way it is currently coded there is no way to
have a heuristic decoder when a content-type header is specified.


In this way if there is a decoder for a specific content-type then it
will be used, then the heuristic decoders have a chance, and finally the
default of either the media-type decoder of the http_payload decoder.



svn path=/trunk/; revision=19208
2006-09-12 11:39:51 +00:00
Ronnie Sahlberg 52c827f1d1 fix for bug 1079
verify that stat_info->request_uri is non null before doing string manipulations on it
so that we dont try to dereference a null pointer further down the code


svn path=/trunk/; revision=19153
2006-09-05 14:32:15 +00:00
Gerald Combs 07f798ed37 Make sure a string pointer exists before we try to use it. Fixes bug 1050.
svn path=/trunk/; revision=19022
2006-08-24 22:05:26 +00:00
Jörg Mayer b21579abef Stephen Fisher <stephentfisher@yahoo.com>
Could you apply the attached patch also to finish it off - I
failed to include it in the original e-mail.

svn path=/trunk/; revision=18906
2006-08-15 06:40:26 +00:00
Jörg Mayer d291a92109 Stephen Fisher <stephentfisher@yahoo.com>
Attached is a patch to packet-http.c that calls a subdissector for
traffic flowing through a proxy via the HTTP CONNECT method.  Most
protocols, especially SSL, can be tunneled through an HTTP proxy.
Wireshark currently says this traffic is "Continuation or non-HTTP
traffic" but this patch turns the payload over to the dissector for the
protocol being tunneled.  This is similar to how the Socks dissector
works.


svn path=/trunk/; revision=18901
2006-08-14 21:46:05 +00:00
Ronnie Sahlberg 5dd51dc735 fix a tiny memory leak where we would lose a few kbyte once when wireshark is starting up
svn path=/trunk/; revision=18579
2006-06-27 12:05:05 +00:00
Ronnie Sahlberg b945d54c9f remove some dead code coverity 17
svn path=/trunk/; revision=18567
2006-06-24 00:01:33 +00:00
Ronnie Sahlberg 617227fe2a change a comment to #if to make it clearer the code is disabled
svn path=/trunk/; revision=18566
2006-06-23 23:51:55 +00:00