Commit Graph

259 Commits

Author SHA1 Message Date
Jakub Zawadzki d7bd2ecf9f Add new proto_tree_add_format_text() function
There are lot of text dissectors which want just to add escaped (not filtrable) text,
add new function proto_tree_add_format_text() which just do this in optimized way.

Change-Id: Ia0e189b620cc0a5b74cfdaef1ad4571d766bb2ab
Reviewed-on: https://code.wireshark.org/review/1678
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-19 02:27:12 +00:00
Alexis La Goutte e9d4f82ab7 HTTP2: with HTTP2 draft-1x, now upgrade use h2-XX or h2c-XX for upgrade HTTP1 Protocol (with XX number of draft)
Change-Id: I7b6394e1a84db34e34b4a05245414b81a62292af
Partial-Bug:10054
Reviewed-on: https://code.wireshark.org/review/1409
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-28 22:15:10 +00:00
Alexis La Goutte b57fc91c68 Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I75aa99b020c92e7caf7efebe34cd1af3763cf592
Reviewed-on: https://code.wireshark.org/review/1397
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-27 20:23:01 +00:00
Alexis La Goutte dec179eab8 Try to fix Mac OS X buildbot
packet-http.c:2629: warning: implicit conversion shortens 64-bit value into a 32-bit value

Change-Id: I6a423639a53c24431fcfd79e0a235f2885ea86c2
Reviewed-on: https://code.wireshark.org/review/1389
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-27 19:30:10 +00:00
Peter Wu 5600ae100a http: Fix src/dest mapping for proxied connections
Using value_is_in_range is making quite some assumptions, namely (1) the
proxy server is always run on a registered HTTP port, and (2) the
source (client) port is always not HTTP. The former is quite a strong
assertion which fails to hold when using a custom port (8008) that got
detected through heuristics.

Fix this by recording the source address and port pair for the server
and then check this against the current packet.

This fixes detection of a SSL conversation where two conversations got
detected instead of one. Example: 8008 is proxy, 443 is target server.
Now the proxied conversation got detected as 443 --> "client port"
(server to client, ok) and 443 --> 8008 (client to server, not ok,
should be "client port" --> 443).

bug:7717
Change-Id: I05113ec2aca6c9296184759a8a62eb32cbfcbb4f
Reviewed-on: https://code.wireshark.org/review/1380
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-27 18:08:44 +00:00
Peter Wu 162a8c72f0 http: Display a list of cookies
For long cookies, the label "[truncated] Cookie: foo=v..." is not really
helpful. Add a new subtree to display individual cookies, this makes
copying values much easier.

A new "http.cookie_pair" field was added instead of re-using
"http.cookie". This has the advantage that `tshark -Tfields -e
http.cookie` does not end up with duplicates. At the same time, one can
match against individual cookie values.

I also considered to limit the number of cookies to be split, but as
there is no limit on the number of headers, I decided not to be
restrictive for cookies either.

Change-Id: I98d9522867811278ade3e04aab02e517f997928b
Reviewed-on: https://code.wireshark.org/review/1186
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-27 17:53:38 +00:00
Michael Mann f8e8c85f99 Limit the start of HTTP request/response to a printable character.
From Martin Mathieson.

In a profiled run with FTP traffic, the HTTP dissector looking for the end of a line of data (which was binary) was taking around 3% of runtime.

bug:8822
Change-Id: I2617d1e49030bd5ad85b0e818c48c01dc6fae075
Reviewed-on: https://code.wireshark.org/review/1373
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-27 12:26:49 +00:00
Guy Harris 6ef0420434 No need to set "line" when setting "firstline".
"line" is used only in the main loop processing the lines.

Change-Id: I370c6516867a9c972f9673b3362141f0f42d178a
Reviewed-on: https://code.wireshark.org/review/1360
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 20:13:14 +00:00
Guy Harris 0b1c5c3f12 Get rid of a (now-)redundant call to tvb_get_ptr().
Also, shuffle some comments around to make them better describe what's
happening.

Change-Id: Ie4d71e7c64b68a7f02b4ec6cd2d8601a796a9867
Reviewed-on: https://code.wireshark.org/review/1359
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 20:08:38 +00:00
Guy Harris ae666f6001 Clean up code formatting a bit.
Change-Id: I8f82630f59304149293680f742d490767b88179e
Reviewed-on: https://code.wireshark.org/review/1358
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-25 20:04:11 +00:00
Michael Mann 182fd1719b Fix fuzz failure. Bug 10041.
Always need to initialize "firstline" when "line" is initialized.

Bug:10041
Change-Id: Iecee2e387e4a35f0d7126f8f14aa5bd34449a5d3
Reviewed-on: https://code.wireshark.org/review/1351
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-25 15:14:07 +00:00
AndersBroman a4ff0bc5d2 Try to please the build boot.
Change-Id: I304960a0d1c8e64947a7f35e90da279e43051aac
Reviewed-on: https://code.wireshark.org/review/1338
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-25 07:24:05 +00:00
Michael Mann 748e0d4221 Create the HTTP tree and set column info after we're assured it's HTTP. Otherwise a bogus tree is created when HTTP2 traffic is found. Also, COL_PROTOCOL and COL_INFO can be prematurely populated.
Change-Id: I9f1c736baaeb86f9fab61601d79e79b4e3a16c38
Reviewed-on: https://code.wireshark.org/review/1334
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-25 04:21:56 +00:00
Evan Huus cb8386c4de Revert "Create the HTTP tree after we're assured it's HTTP. Otherwise a bogus tree is created when HTTP2 traffic is found."
It causes the DTLS decryption test suite to fail for some reason, and I don't have time/energy to investigate further, so we should probably revert it until that gets resolved.

This reverts commit fc5d8db74d.

Change-Id: Iac9a7592047d2e080e380a70752efa076303e442
Reviewed-on: https://code.wireshark.org/review/1297
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-23 12:59:14 +00:00
Michael Mann fc5d8db74d Create the HTTP tree after we're assured it's HTTP. Otherwise a bogus tree is created when HTTP2 traffic is found.
Change-Id: Ic315ed9b7d65fe70401945cb0cceda4af863d140
Reviewed-on: https://code.wireshark.org/review/1215
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-20 12:40:43 +00:00
Pascal Quantin 828bb24226 Partly revert fdeed480bf
wmem_packet_scope() cannot be used outside of a packet treatment

Change-Id: I6e545bbb51f325b366288f17358f9d2347a7d7c4
Reviewed-on: https://code.wireshark.org/review/977
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-06 10:18:15 +00:00
Michael Mann fdeed480bf Convert ep_address_to_str -> address_to_str(wmem_packet_scope, ...) for all dissectors
Change-Id: I7489e2fb3a1f2630ca17b0a5fe1aa873992f1061
Reviewed-on: https://code.wireshark.org/review/975
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-06 01:31:28 +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
Gilbert Ramirez 4cc694839d Fix all -fstrict-alias warnings found by gcc 4.1.2
The majority of the fixes are for calls to uat_new(). Instead of
having each caller cast its private data to (void**), we use void*
in the uat_new() API itself. Inside uat_new(), we cast the void*
to void**.

Some dissectors use val64_string arrays, so a VALS64() macro was
added for those, to avoid using VALS(), which is useful only for
value_string arrays.

packet-mq.c was changed because dissect_nt_sid() requires
a char**, not a guint**. All other callers of dissect_nt_sid() use
char*'s (and take the address of it) for their local storage. So,
this was changed to follow the other practices.

A confusion between gint and absolute_time_display_e in packet-time.c
was cleared up.

The ugliest fix is the addition of ip6_guint8_to_str(), for exactly
one caller. The caller uses one type of ip6 address byte array,
while ip6_to_str() expects another. This new function is in place
until the various address implementations can be consolidated.

Add VALS64() to the developer documentation.

Change-Id: If93ff5c6c8c7cc3c9510d7fb78fa9108e4552805
Reviewed-on: https://code.wireshark.org/review/48
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-03 09:26:10 +00:00
Martin Kaiser d6b1e2e95c use https instead of http in the url when the packet contains ssl
svn path=/trunk/; revision=54440
2013-12-24 13:53:09 +00:00
Jakub Zawadzki deb2b236f2 Add missing includes
svn path=/trunk/; revision=54332
2013-12-21 17:23:17 +00:00
Jakub Zawadzki be733f3041 Move epan/base64.[ch] to wsutil/ with function name change.
svn path=/trunk/; revision=54326
2013-12-21 14:38:51 +00:00
Bill Meier e2c5575e80 Cast result of strtol() to guint32;
svn path=/trunk/; revision=54266
2013-12-19 19:29:44 +00:00
Bill Meier 0afeb2ae95 Change editor modelines value for 'indent-tabs-mode' from 'true' to 't'
so emacs doesn't complainab 'unsafe value'.

svn path=/trunk/; revision=54153
2013-12-16 20:22:50 +00:00
Jakub Zawadzki c45475ab45 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54135
2013-12-15 23:44:12 +00:00
Chris Maynard bc1b084ae1 Trivial: Spaces -> tabs.
svn path=/trunk/; revision=53975
2013-12-12 20:09:33 +00:00
Michael Mann 9b7fb8a811 Create the ability to have packet scoped "proto" data. Bug 9470 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470)
I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future.  And search/replace of a function name is easy enough to do.

The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As.

All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope().  All other dissectors were converted to using file_scope() which was the original scope for "proto" data.

svn path=/trunk/; revision=53520
2013-11-23 02:20:13 +00:00
Guy Harris 4302292936 You have to cast void pointers to another type in C++; implicit
conversions aren't valid.

svn path=/trunk/; revision=53037
2013-11-02 00:50:24 +00:00
Michael Mann f8f1f48371 Pass struct tcpinfo into all TCP subdissectors instead of through pinfo->private_data.
svn path=/trunk/; revision=53036
2013-11-02 00:36:30 +00:00
Evan Huus a3648730a6 Replace some proto_tree_add_string_format with proto_tree_add_item +
proto_tree_set_text - the string was not the important part, the formatting was.
We were passing the string directly from tvb_get_ptr, but this meant that if the
packet didn't contain a null-terminator we would run off the end. Since the
string comes straight from the packet, just let _add_item handle the length
calculations etc efficiently, and set the display later.

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

I'm a bit confused honestly why most of these are being set hidden after being
added and formatted, but at least there are no memory errors anymore.

svn path=/trunk/; revision=52979
2013-10-30 02:09:34 +00:00
Evan Huus 95f484a91e Add a very small hack to make the UAT update callback error string freeable, and
convert all existing UAT update callbacks to use glib memory instead of
ephemeral memory for that string.

UAT code paths are entirely distinct from packet dissection, so using ephemeral
memory was the wrong choice, because there was no guarantees about when it would
be freed.

The move away from emem still needs to be propogated deeper into the UAT code
itself at some point.

Net effect: remove another bunch of emem calls from dissectors, where replacing
with wmem would have caused assertions.

svn path=/trunk/; revision=52854
2013-10-25 22:14:25 +00:00
Michael Mann 9e494dbe18 Be able to search through HTTP request and HTTP response lines. Bug 9134 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9134)
From Edwin Groothuis

svn path=/trunk/; revision=52656
2013-10-17 01:23:12 +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 868b345eea Convert a few more dissectors to wmem API
svn path=/trunk/; revision=52053
2013-09-15 10:29:49 +00:00
Chris Maynard 0b0cb31ac4 Test the return value of tvb_reported_length_remaining() as > 0 rather than != 0. While in these cases, I don't see any actual bugs due to other protections, I don't think it hurts to make this change and should help avoid others from copying/pasting this code elsewhere, where similar protections may not be in place.
svn path=/trunk/; revision=51959
2013-09-11 21:44:13 +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
Evan Huus 808d594087 Add an expert info if we see content-length header and chunked encoding
together.

The other part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9101

Also fix modelines.

svn path=/trunk/; revision=51786
2013-09-05 16:05:32 +00:00
Pascal Quantin ac5619426a Deactivate debug code
svn path=/trunk/; revision=51596
2013-08-30 12:31:14 +00:00
Alexis La Goutte b7d30a72a5 HTTP2 Upgrade heuristic for HTTP (Work with HTTP-draft-XX/2.0 and HTTP/2.0)
svn path=/trunk/; revision=51592
2013-08-30 11:14:18 +00:00
Anders Broman f6b9c18eed Use dissector_delete_uint_range/dissector_add_uint_range
svn path=/trunk/; revision=51567
2013-08-28 19:10:33 +00:00
Pascal Quantin b46f9bebe2 Change some dissectors to use pinfo memory pool instead of malloc if it can trigger an exception between between buffer allocation and tvb_set_free_cb call
svn path=/trunk/; revision=51427
2013-08-19 14:55:41 +00:00
Jakub Zawadzki 9cfac1227d Replace hfinfo pointer to same_name_prev, with same_name_prev_id.
svn path=/trunk/; revision=51175
2013-08-06 20:53:47 +00:00
Jakub Zawadzki 5fa2a99087 Keep result of [new_]register_dissector in some dissectors.
svn path=/trunk/; revision=51156
2013-08-05 18:09:43 +00:00
Michael Mann 0f0c111119 Remove check_col() and the occasional tree.
svn path=/trunk/; revision=49920
2013-06-14 01:02:11 +00:00
Sake Blok dea156c3d5 Rename "http.response_ts" to "http.time" to be inline with other response time fiels (like dns.time and smb.time etc)
svn path=/trunk/; revision=49630
2013-05-30 07:16:04 +00:00
Jeff Morriss 34230e736d Fix the infinite recursion problem reported in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8733 :

We can't solely rely on the port in the URI to determine whether we will be
recursively called by decode_tcp_ports().  Instead also check the conversation
entry too: if we find that we are the subdissector for this conversation
(which we might be--without the port being in our list of ports--if we
heuristically picked up the conversation or the user did Decode-As),
just bail out and dissect the payload as data.

svn path=/trunk/; revision=49623
2013-05-29 22:43:20 +00:00
Michael Mann 5bc22a25df Batch of filterable expert infos.
svn path=/trunk/; revision=49584
2013-05-26 03:29:07 +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
Guy Harris 3295912210 Try to handle lines with NULs in them. They aren't valid lines, but at
least one fuzzed capture contains them, and using ep_strndup() to copy
the line means that the actual amount of memory allocated for the copy
will be less than the length of the line, and code that parses the line
assuming that there are value_len+1 bytes in the buffer (including the
terminating NUL), such as the current parsing code, will break.

We should really have code in Wireshark to handle counted strings, and
have those be what we extract from packets.  (And we should handle
non-UTF-8/non-UTF-16 encodings, and octet sequences that aren't valid
strings for their encoding, and handle display of invalid strings and
non-printable characters, and....).

Use g_ascii_ versions of various isXXX() and to{upper,lower}(), so we
don't get surprised by the behavior of the user's locale.

svn path=/trunk/; revision=48490
2013-03-22 23:18:30 +00:00
Anders Broman 81e80f2c0b From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48355
2013-03-17 16:48:47 +00:00
Anders Broman 30a9b4855d Detect HTTP/1.1 heuristically.
svn path=/trunk/; revision=48263
2013-03-12 19:15:39 +00:00
Anders Broman 2cc00294c7 Use explicit casts.
svn path=/trunk/; revision=48260
2013-03-12 06:41:00 +00:00
Evan Huus 0f8735b8a3 From Dirk via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8287
Request-response tracking and response-time calculation for HTTP.

svn path=/trunk/; revision=47694
2013-02-16 14:59:00 +00:00
Guy Harris a4714f643a Add a routine to allow dissectors to specify ports that carry HTTP
traffic *without* claiming all that traffic for themselves; they might
want, instead, to register for a particular media type.

Not all traffic to or from port 3689 is DAAP - not even traffic between
two Apple machines doing media stuff (e.g., some FairPlay traffic
isn't).  Register for the media type application/x-dmap-tagged, and just
say port 3689 is HTTP.  This means we can get rid of the FPLY hack, as
that traffic is application/octet-stream.  Update some comments.

Leave it up to the DAAP dissector to tag traffic as DAAP in the protocol
column.

svn path=/trunk/; revision=47376
2013-01-30 21:49:33 +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
Alexis La Goutte 94ae27661e From vanviegen via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7934 WebSocket dissector improvements
- Now works for WebSocket packets not aligned with IP packets.
- Support subdissectors.

From me :
- Fix checkAPIs warning (about comments)
- Remove some whitespace

svn path=/trunk/; revision=45875
2012-11-02 20:35:24 +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
Jakub Zawadzki 9f92dc93c5 Add data parameter to call_dissector_only.
svn path=/trunk/; revision=44872
2012-09-11 08:28:07 +00:00
Jakub Zawadzki dee4443809 Add data parameter to dissector_try_heuristic
svn path=/trunk/; revision=44871
2012-09-11 08:26:48 +00:00
Sake Blok 66115d1200 Enhance the http dissector to correctly reassemble http
headers when the first tcp segment does not contain a
full line.


svn path=/trunk/; revision=44593
2012-08-19 23:52:37 +00:00
Michael Mann 5dd7371960 more ephemeral memory cleanup
svn path=/trunk/; revision=44496
2012-08-14 17:58:41 +00:00
Guy Harris 659cf0527a UATs could be put into "categories". The categories were defined only
implicitly by the #define name and string they were defined to; not all
UATs neatly fit into any of the categories, so some of them were put
into categories that weren't obviously correct for them, and one - the
display filter macro UAT - wasn't put into any category at all (which
caused crashes when editing them, as the GUI code that handled UAT
changes from a dialog assumed the category field was non-null).

The category was, in practice, used only to decide, in the
aforementioned GUI code, whether the packet summary pane needed to be
updated or not.  It also offered no option of "don't update the packet
summary pane *and* don't redissect anything", which is what would be
appropriate for the display filter macro UAT.

Replace the category with a set of fields indicating what the UAT
affects; we currently offer "dissection", which applies to most UATs
(any UAT in libwireshark presumably affects dissection at a minimum) and
"the set of named fields that exist".  Changing any UAT that affects
dissection requires a redissection; changing any UAT that affects the
set of named fields that exist requires a redissection *and* rebuilding
the packet summary pane.

Perhaps we also need "filtering", so that if you change a display filter
macro, we re-filter, in case the display is currently filtered with a
display filter that uses a macro that changed.

svn path=/trunk/; revision=43603
2012-07-08 01:00:46 +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 4f2c3a8e86 len is no longer used.
svn path=/trunk/; revision=43200
2012-06-11 08:07:48 +00:00
Anders Broman 34cb6f96d3 From Michael Mann:
NUL terminate the decoded string.  
Updated only dissector that uses epan_base64_decode() (packet-http.c) to assume
NULL termination.

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

svn path=/trunk/; revision=43196
2012-06-11 07:09:11 +00:00
Bill Meier 3523b34d65 Add new HTTP Status Codes from RFC 6585;
Also: Add codes 226 & 426 as specified in the IANA HTTP Status Code Registry

svn path=/trunk/; revision=42372
2012-05-01 02:42:51 +00:00
Alexis La Goutte 284405d5eb From me for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6843
Make WebSocket HTTP Header (Sec-WebSocket-*) filterable

svn path=/trunk/; revision=42164
2012-04-20 15:32:45 +00:00
Alexis La Goutte 456d6fbb53 From me for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6843
Add WebSocket Protocol dissector (RFC6455)
* Support Base Framing Protocol
* Support of major opcode (Text, Binary, Close, Ping, Pong...)
* Support of unmask Payload (Client-to-Server Masking)

TODO 
* Add fragmentation support
* Add WebSocket Extensions

svn path=/trunk/; revision=42163
2012-04-20 15:31:15 +00:00
Anders Broman 84e8250146 From Pascal Quantin:
Ignore Content-Length if Transfer-Encoding is present

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

svn path=/trunk/; revision=42046
2012-04-13 13:10:38 +00:00
Stig Bjørlykke 019008548b Recreate the packet list when changing UAT for header fields.
This fixes a crash when changing settings for fields used as a custom column.

svn path=/trunk/; revision=41840
2012-03-30 08:57:57 +00:00
Jeff Morriss c13c14429b Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6982 :
Check the user-provided custom header string for invalid characters before
trying to register it in an hf; registering invalid characters in an hf will
lead to an assertion.

svn path=/trunk/; revision=41787
2012-03-27 01:43:20 +00:00
Stig Bjørlykke 377ea887bb Improved a if-check to avoid a analyzis warning.
svn path=/trunk/; revision=41508
2012-03-12 17:18:54 +00:00
Guy Harris 7e51e80fe0 To quote section "7.2.1 Type" of RFC 2068, "Hypertext Transfer Protocol
-- HTTP/1.1":

   Any HTTP/1.1 message containing an entity-body SHOULD include a
   Content-Type header field defining the media type of that body. If
   and only if the media type is not given by a Content-Type field, the
   recipient MAY attempt to guess the media type via inspection of its
   content and/or the name extension(s) of the URL used to identify the
   resource. If the media type remains unknown, the recipient SHOULD
   treat it as type "application/octet-stream".

To quote section "4. Encoding of Transport Layer" of RFC 2565, "Internet
Printing Protocol/1.0: Encoding and Transport":

   HTTP/1.1 [RFC2068] is the transport layer for this protocol.

	...

   Note: even though port 631 is the IPP default, port 80 remains the
   default for an HTTP URI.  Thus a URI for a printer using port 631
   MUST contain an explicit port, e.g. "http://forest:631/pinetree".  An
   HTTP URI for IPP with no explicit port implicitly reference port 80,
   which is consistent with the rules for HTTP/1.1. Each HTTP operation
   MUST use the POST method where the request-URI is the object target
   of the operation, and where the "Content-Type" of the message-body in
   each request and response MUST be "application/ipp". The message-body
   MUST contain the operation layer and MUST have the syntax described
   in section 3.2 "Syntax of Encoding". A client implementation MUST
   adhere to the rules for a client described for HTTP1.1 [RFC2068]. A
   printer (server) implementation MUST adhere the rules for an origin
   server described for HTTP1.1 [RFC2068].

So, when choosing a subdissector for HTTP request bodies, search based
on the media type first, and only if we *don't* find a dissector for the
media type, do other stuff such as heuristics or choosing a subdissector
based on the port number.

This fixes a number of problems; in particular, it fixes bug 6765
"non-IPP packets to or from port 631 are dissected as IPP" without
requiring the IPP dissector to attempt to determine whether an entity
body looks like IPP.  It also ensures that the default dissector for
HTTP entity bodies, the "media" dissector, will get the media type
passed to it in pinfo->match_string.

Don't use "!str*cmp()" while we're at it - it's valid C, but the "!" can
make it look as if it's checking for something not being the case when,
in fact, you're checking for equality rather than inequality.  (The
str*cmp() routines don't return Boolean results.)

svn path=/trunk/; revision=41025
2012-02-14 06:00:14 +00:00
Chris Maynard 3db18f185e Fix some typos.
svn path=/trunk/; revision=40787
2012-02-01 02:05:19 +00:00
Anders Broman 20881c49bb From Claudio:
linear white space (LWS) not ignored after HTTP header field content.

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

svn path=/trunk/; revision=40753
2012-01-28 17:04:48 +00:00
Bill Meier dda0d791c9 Use correct reported_length for a tvb_new_subset() (not that it makes a difference in this case).
svn path=/trunk/; revision=40257
2011-12-21 03:44:23 +00:00
Bill Meier a0731cfeb8 Create "Dehunked Entity Body" with O(N) rather than O(N^2) efffort.
[Actually 1 g_malloc() + N tvb_memcpy() instead of
~ N g_malloc()/g_free() + N*(N+1)/2 tvb_memcpy() where N = number of chunks].

svn path=/trunk/; revision=40242
2011-12-18 18:31:30 +00:00
Bill Meier c60d239123 From Claudio: header value always computed twice
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6592

svn path=/trunk/; revision=39975
2011-11-21 17:58:47 +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
Stig Bjørlykke 7714898212 Cleanup the unregister loop to avoid freeing wrong data.
svn path=/trunk/; revision=39268
2011-10-05 11:44:29 +00:00
Stig Bjørlykke 19e87afd9d Free duplicated strings in hf entries.
svn path=/trunk/; revision=39258
2011-10-04 21:06:20 +00:00
Stig Bjørlykke 8c8cd4024c Unregister and delete allocated header fields when updating the UAT.
Avoid double loading the UAT.
Use the post update callback in uat_new for regenerating header_fields_hash.

svn path=/trunk/; revision=39251
2011-10-04 18:40:56 +00:00
Anders Broman 0d89708ab2 Add notes and links on SSDP
svn path=/trunk/; revision=38913
2011-09-07 09:02:09 +00:00
Gerald Combs 49b92440de More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versions
in README.devloper. Remove g_gnuc.h since it's no longer needed. Remove
tvbuff_init(), tvbuff_cleanup(), reassemble_init(), and
reassemble_cleanup() since they were only used for older GLib versions
which didn't support GSlices. Assume we always support the "matches"
operator.

svn path=/trunk/; revision=37978
2011-07-11 20:32:19 +00:00
Guy Harris a3ae744636 Add port 2710 for the XBT BitTorrent tracker (and note why it's added;
the other unusual ports should be mentioned as well).

svn path=/trunk/; revision=37952
2011-07-10 18:34:15 +00:00
Jeff Morriss 7ad71a2d78 Treat TVBs as opaque: use the accessor functions instead of accessing the fields
directly.

svn path=/trunk/; revision=37420
2011-05-27 01:57:33 +00:00
Stig Bjørlykke c92938bbc0 Support content-type x-gzip and x-deflate, as described in RFC2616 as
equivalent to gzip and deflate.

This fixes bug 5882.

svn path=/trunk/; revision=36963
2011-05-02 14:06:33 +00:00
Alexis La Goutte 8b61d83f5e Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=36700
2011-04-18 17:38:08 +00:00
Jeff Morriss dd9f86c38d The 'name's passed to tick_stat_node() do not need to be static.
svn path=/trunk/; revision=36341
2011-03-26 01:21:43 +00:00
Jeff Morriss bb61772be7 From Dirk: fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2930 :
Make the image (png, gif, jfif) dissectors "new style" so that they don't
dissect data that does not belong to them.

Modify the HTTP dissector to call heuristic dissectors on the body if the
registered subdissector does not accept/dissect the data.

From me: don't use assert() and don't add a preference to the HTTP dissector
for this behavior: it makes sense to behave like that by default.

svn path=/trunk/; revision=36305
2011-03-24 02:49:05 +00:00
Gerald Combs 1b4d847a90 Add 2869 to the list of HTTP ports: http://support.microsoft.com/kb/886257
svn path=/trunk/; revision=35461
2011-01-10 20:23:21 +00:00
Jaap Keuter 302d4c14df From Julien Kerihuel:
I've just finished to write a ncacn_http dissector for Wireshark which
provides the ability to dissect Outlook anywhere packets properly (as
specified by [MS-RPCH].pdf documentation.

svn path=/trunk/; revision=35259
2010-12-23 23:50:14 +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
Anders Broman 738813862b From Robert Bullen:
Improve the HTTP dissection of the Response Status Line.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5338

svn path=/trunk/; revision=34712
2010-10-30 14:29:20 +00:00
Guy Harris 17d4d51b7d Make the third argument to a UAT copy callback a size_t (not that any of
the callbacks we have use that argument - is it really needed?).

svn path=/trunk/; revision=34694
2010-10-29 21:11:33 +00:00
Jaap Keuter 3db66ff53e Try to decode the unknown multipart subtype anyway.
svn path=/trunk/; revision=34658
2010-10-27 06:49:18 +00:00
Jeff Morriss 36390c306f From Yaniv Kaul via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5336 :
Attached patch:
1. Adds port 5985 as a HTTP traffic port (used by MS Powershell remoting over
HTTP)
2. Adds dissection of Kerberos authentication to HTTP.


svn path=/trunk/; revision=34641
2010-10-25 02:17:41 +00:00
Jeff Morriss 46ef82837f Add a cast
svn path=/trunk/; revision=34164
2010-09-21 03:06:54 +00:00
Jeff Morriss 79e39c7ecb Use size_t to keep the Windows compiler happy
svn path=/trunk/; revision=34163
2010-09-21 02:41:29 +00:00