aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-http.c
AgeCommit message (Collapse)AuthorFilesLines
2013-12-12Trivial: Spaces -> tabs.Chris Maynard1-38/+38
svn path=/trunk/; revision=53975
2013-11-23Create the ability to have packet scoped "proto" data. Bug 9470 ↵Michael Mann1-3/+3
(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-02You have to cast void pointers to another type in C++; implicitGuy Harris1-1/+2
conversions aren't valid. svn path=/trunk/; revision=53037
2013-11-02Pass struct tcpinfo into all TCP subdissectors instead of through ↵Michael Mann1-8/+10
pinfo->private_data. svn path=/trunk/; revision=53036
2013-10-30Replace some proto_tree_add_string_format with proto_tree_add_item +Evan Huus1-11/+19
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-25Add a very small hack to make the UAT update callback error string freeable, andEvan Huus1-3/+3
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-17Be able to search through HTTP request and HTTP response lines. Bug 9134 ↵Michael Mann1-7/+57
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9134) From Edwin Groothuis svn path=/trunk/; revision=52656
2013-09-22emem -> wmem conversion:Pascal Quantin1-3/+3
- 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-15Convert a few more dissectors to wmem APIPascal Quantin1-20/+19
svn path=/trunk/; revision=52053
2013-09-11Test the return value of tvb_reported_length_remaining() as > 0 rather than ↵Chris Maynard1-7/+7
!= 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-09expert_add_info_format_text -> expert_add_info_formatMichael Mann1-1/+1
svn path=/trunk/; revision=51852
2013-09-05Add an expert info if we see content-length header and chunked encodingEvan Huus1-2/+12
together. The other part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9101 Also fix modelines. svn path=/trunk/; revision=51786
2013-08-30Deactivate debug codePascal Quantin1-2/+2
svn path=/trunk/; revision=51596
2013-08-30HTTP2 Upgrade heuristic for HTTP (Work with HTTP-draft-XX/2.0 and HTTP/2.0)Alexis La Goutte1-1/+15
svn path=/trunk/; revision=51592
2013-08-28Use dissector_delete_uint_range/dissector_add_uint_rangeAnders Broman1-11/+2
svn path=/trunk/; revision=51567
2013-08-19Change some dissectors to use pinfo memory pool instead of malloc if it can ↵Pascal Quantin1-3/+1
trigger an exception between between buffer allocation and tvb_set_free_cb call svn path=/trunk/; revision=51427
2013-08-06Replace hfinfo pointer to same_name_prev, with same_name_prev_id.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=51175
2013-08-05Keep result of [new_]register_dissector in some dissectors.Jakub Zawadzki1-4/+5
svn path=/trunk/; revision=51156
2013-06-14Remove check_col() and the occasional tree.Michael Mann1-21/+17
svn path=/trunk/; revision=49920
2013-05-30Rename "http.response_ts" to "http.time" to be inline with other response ↵Sake Blok1-4/+4
time fiels (like dns.time and smb.time etc) svn path=/trunk/; revision=49630
2013-05-29Fix the infinite recursion problem reported inJeff Morriss1-7/+21
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-26Batch of filterable expert infos.Michael Mann1-3/+14
svn path=/trunk/; revision=49584
2013-05-12Add the posibillity to use a key for per-packet-data.Anders Broman1-3/+3
svn path=/trunk/; revision=49259
2013-03-22Try to handle lines with NULs in them. They aren't valid lines, but atGuy Harris1-4/+14
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-17From beroset:Anders Broman1-1/+1
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48355
2013-03-12Detect HTTP/1.1 heuristically.Anders Broman1-0/+33
svn path=/trunk/; revision=48263
2013-03-12Use explicit casts.Anders Broman1-17/+17
svn path=/trunk/; revision=48260
2013-02-16From Dirk via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8287Evan Huus1-2/+170
Request-response tracking and response-time calculation for HTTP. svn path=/trunk/; revision=47694
2013-01-30Add a routine to allow dissectors to specify ports that carry HTTPGuy Harris1-6/+11
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
2012-12-26Fix a bunch of warnings.Guy Harris1-6/+6
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-11-02From vanviegen via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7934 ↵Alexis La Goutte1-11/+18
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-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45017
2012-09-11Add data parameter to call_dissector_only.Jakub Zawadzki1-2/+2
svn path=/trunk/; revision=44872
2012-09-11Add data parameter to dissector_try_heuristicJakub Zawadzki1-1/+1
svn path=/trunk/; revision=44871
2012-08-19Enhance the http dissector to correctly reassemble httpSake Blok1-1/+15
headers when the first tcp segment does not contain a full line. svn path=/trunk/; revision=44593
2012-08-14more ephemeral memory cleanupMichael Mann1-9/+2
svn path=/trunk/; revision=44496
2012-07-08UATs could be put into "categories". The categories were defined onlyGuy Harris1-1/+3
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-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-06-11len is no longer used.Anders Broman1-2/+1
svn path=/trunk/; revision=43200
2012-06-11From Michael Mann:Anders Broman1-1/+0
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-05-01Add new HTTP Status Codes from RFC 6585;Bill Meier1-7/+15
Also: Add codes 226 & 426 as specified in the IANA HTTP Status Code Registry svn path=/trunk/; revision=42372
2012-04-20From me for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6843Alexis La Goutte1-0/+30
Make WebSocket HTTP Header (Sec-WebSocket-*) filterable svn path=/trunk/; revision=42164
2012-04-20From me for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6843Alexis La Goutte1-2/+21
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-13From Pascal Quantin:Anders Broman1-1/+7
Ignore Content-Length if Transfer-Encoding is present https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5182 svn path=/trunk/; revision=42046
2012-03-30Recreate the packet list when changing UAT for header fields.Stig Bjørlykke1-1/+1
This fixes a crash when changing settings for fields used as a custom column. svn path=/trunk/; revision=41840
2012-03-27Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6982 :Jeff Morriss1-9/+21
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-12Improved a if-check to avoid a analyzis warning.Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=41508
2012-02-14To quote section "7.2.1 Type" of RFC 2068, "Hypertext Transfer ProtocolGuy Harris1-7/+17
-- 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-01Fix some typos.Chris Maynard1-3/+3
svn path=/trunk/; revision=40787
2012-01-28From Claudio:Anders Broman1-2/+5
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