aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-multipart.c
AgeCommit message (Collapse)AuthorFilesLines
2016-08-31Don't do any Decode As stuff for dissector tables not used with Decode As.Guy Harris1-1/+1
Have all dissector tables have a "supports Decode As" flag, which defaults to FALSE, and which is set to TRUE if a register_decode_as() refers to it. When adding a dissector to a dissector table with a given key, only add it for Decode As if the dissector table supports it. For non-FT_STRING dissector tables, always check for multiple entries for the same protocol with different dissectors, and report an error if we found them. This means there's no need for the creator of a dissector table to specify whether duplicates of that sort should be allowed - we always do the check when registering something for "Decode As" (in a non-FT_STRING dissector table), and just don't bother registering anything for "Decode As" if the dissector table doesn't support "Decode As", so there's no check done for those dissector tables. Change-Id: I4a1fdea3bddc2af27a65cfbca23edc99b26c0eed Reviewed-on: https://code.wireshark.org/review/17402 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-23Handle quoted-pairs in quoted-strings correctly.Guy Harris1-54/+38
Backslash, in a quoted-string, escapes quotes (and any other characters, although the only ones that *need* escaping are a double-quote and a backslash). This means that the value of a parameter isn't just the raw characters from the parameters string; for a quoted string, it needs to be un-escaped, and for a *non*-quoted string, it has to stop at the first non-token character (you can put comments in). So ws_find_media_type_parameter() must return an allocated string with the actual value. Get rid of index_of_char(); it doesn't do anything that strchr() does. Change-Id: I36328ea71c28fe6ac4918a8e73c281a25f6be844 Reviewed-on: https://code.wireshark.org/review/17251 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-22Make index_of_char() static againBalint Reczey1-0/+19
Change-Id: I1c0d344c50ee5d78dd8247ccfe795ce0cd94aaa2 Reviewed-on: https://code.wireshark.org/review/17230 Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2016-08-22Rename find_parameter() to ws_find_media_type_parameter()Balint Reczey1-5/+5
The symbols exported from libs should use less generic. preferably prefixed names to avoid name collisions with other shared library symbols. Change-Id: I8323b3e194a7ee4d61baec0c007342fab6cbde84 Reviewed-on: https://code.wireshark.org/review/17229 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-22Pass an HTTP message type to all HTTP subdissectors.Guy Harris1-112/+31
This gets complicated, because those subdissectors might be called by other dissectors as well. We need a better way of passing that sort of out-of-bound information. Pull some routines used for processing Content-Type parameters into common code; we can't guarantee that the media parameters passed in would be writable (passing it as *the* data hid that; passing a structure with that *and* the HTTP message type revealed it), so don't convert it to lower-case in place. Use that information, if available, to determine whether an IPP message is a requet or a response. Change-Id: I4bccc9f05cd0b14ad445be7ab37b3d884d841325 Reviewed-on: https://code.wireshark.org/review/17216 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-20Convert some g_ APIs to wmem.Michael Mann1-27/+5
Change-Id: I7fb0b60fc54004326680f07298fe43e8c48e9b39 Reviewed-on: https://code.wireshark.org/review/16550 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-03-20Create call_data_dissector() to call data dissector.Michael Mann1-5/+3
This saves many dissectors the need to find the data dissector and store a handle to it. There were also some that were finding it, but not using it. For others this was the only reason for their handoff function, so it could be eliminated. Change-Id: I5d3f951ee1daa3d30c060d21bd12bbc881a8027b Reviewed-on: https://code.wireshark.org/review/14530 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20Manually add protocol dependencies derived from find_dissector.Michael Mann1-2/+2
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector. Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector. "data" dissector was not considered to be a dependency. Change-Id: I15d0d77301306587ef8e7af5876e74231816890d Reviewed-on: https://code.wireshark.org/review/14509 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-17Associate dissector tables and heuristic subdissector lists with a protocol.Michael Mann1-1/+1
This will make it easier to determine protocol dependencies. Some LLC OUI dissector tables didn't have an associated protocol, so they were left without one (-1 used) Change-Id: I6339f16476510ef3f393d6fb5d8946419bfb4b7d Reviewed-on: https://code.wireshark.org/review/14446 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-15multipart: Add Content-Description headerStig Bjørlykke1-8/+18
Change-Id: I10432e813832cf6facc33bf3c06872bd9611a4c5 Reviewed-on: https://code.wireshark.org/review/13954 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-05Multipath: use directly value of sizeof(guint32)Alexis La Goutte1-2/+2
it will be also make happy OS X x64 buildbot Change-Id: Ib718d717719739314170632f04b3ec68c2917ed6 Reviewed-on: https://code.wireshark.org/review/13730 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-04Multipart: add dissection of multipart/encrypted and also fix problems to ↵DiablosOffens1-38/+197
find the right boundaries Bug: 11978 Change-Id: Ia31e1b451bfae268e8ede84bddffd5dae8d97d8e Signed-off-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-on: https://code.wireshark.org/review/12281 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-08Fix a lot of typos and misspellingsmoshekaplan1-2/+2
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3 Reviewed-on: https://code.wireshark.org/review/13069 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09new_create_dissector_handle -> create_dissector_handle for dissector directory.Michael Mann1-1/+1
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now. Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f Reviewed-on: https://code.wireshark.org/review/12484 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04Don't allow multiple registrations of a protocol in dissector tables.Michael Mann1-1/+1
The target here is the Decode As dialog where protocols have multiple registrations into a dissector table and that shows up as multiple entries in the Decode As dialog list with the same name so users are unsure which "dissector" they are choosing. The "default" behavior (done in this commit) is to not allow duplicates for a dissector table, whether its part of Decode As or not. It's just ENFORCED for Decode As. Bug: 3949 Change-Id: Ibe14fa61aaeca0881f9cc39b78799e314b5e8127 Reviewed-on: https://code.wireshark.org/review/11405 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-04MIME Multipart: fix display of the last IMF fieldPascal Quantin1-0/+4
Regression was introduced in g23f0e16 Bug: 11249 Change-Id: I2822a4452d3cdf2e53e5f3f1f3034e758fec129b Reviewed-on: https://code.wireshark.org/review/8747 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-02-10Do not iterate over reported length when using tvb_find_line_endPascal Quantin1-2/+2
if captured length < reported length, this will trigger an infinite loop Change-Id: I6557b455e7bbff12658a934e5bb13a42c023e133 Reviewed-on: https://code.wireshark.org/review/7053 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-23Deleting unnecessary #includes from dissectors.Martin Mathieson1-1/+0
Fourth batch (packet-mac-lte.c -> packet-rtp.c). Will look at cleaning up and committing script afterwards. Change-Id: Id921f07f4b274f0cfb77ce81abe4a285fdb8b644 Reviewed-on: https://code.wireshark.org/review/6023 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-4/+0
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-15exit if the key wasn't found in the parameters listMartin Kaiser1-0/+3
Bug: 10761 Change-Id: I072cd3a68d852cb8dc57b9b9f807f792caba7259 Reviewed-on: https://code.wireshark.org/review/5750 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-12-02multipart: Handle multipart/signedStig Bjørlykke1-0/+2
Change-Id: I39742dcce79fc41344c64e5266304c8c120aeb7c Reviewed-on: https://code.wireshark.org/review/5557 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-02multipart: Don't include boundary in preamble.Stig Bjørlykke1-2/+2
Change-Id: I2d2fd28462b974e4ad656e36f2562633d0743962 Reviewed-on: https://code.wireshark.org/review/5556 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-25Ensure dissector data parameter is used instead of pinfo->private_data when ↵Michael Mann1-10/+7
passing data between dissectors using the "media_type" subdissector. Change-Id: I82cbfed770b41404bc42cb6a4413db07d04dffdc Reviewed-on: https://code.wireshark.org/review/5462 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-25Have media dissector take its "media type parameter" from dissector data ↵Michael Mann1-1/+1
parameter instead of pinfo->private_data. Change-Id: I0a0cb0b4838bc4e55a759fb6031355892c220c8e Reviewed-on: https://code.wireshark.org/review/5461 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-21Replace tvb_length()AndersBroman1-11/+11
Change-Id: I0b5ad4d588f0b658abaf3892d08d6520ecd2f645 Reviewed-on: https://code.wireshark.org/review/5431 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-13Eliminate proto_tree_add_text for some dissectors.Michael Mann1-23/+34
Change-Id: Ide14bcac0b1563bee4260ac9c1a280ba99e97e71 Reviewed-on: https://code.wireshark.org/review/5261 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-20Get rid of calls to ctype.h functions.Guy Harris1-3/+2
They don't handle values outside the range -1 to 127, and their behavior is locale-dependent. Use g_ascii_isXXX() and g_ascii_toXXX() instead of isXXX() and toXXX(). If you're checking for printable ASCII, don't use isascii() and don't use iscntrl(), use g_ascii_isprint(). If you're checking for graphical ASCII, i.e. printable ASCII except for a space, use g_ascii_isgraph(). Use ws_xton() to convert a hex digit character to the corresponding numeric value. Change-Id: Id3039bc586fbf66d8736c2df248c790c0d7a2330 Reviewed-on: https://code.wireshark.org/review/4851 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-29Add editor modelines and adjust indentation as needed.Bill Meier1-0/+13
Change-Id: I857700d685354b0bc9e0ca647c57faba981b520f Reviewed-on: https://code.wireshark.org/review/4373 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-11/+11
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-11/+11
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18Fixup: tvb_get_string(z) -> tvb_get_string(z)_encDario Lombardo1-2/+2
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe Reviewed-on: https://code.wireshark.org/review/2376 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-07tvb_new_subset -> tvb_new_subset_length when length parameters are equal.Michael Mann1-2/+1
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is. Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d Reviewed-on: https://code.wireshark.org/review/1999 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-27Use proto_tree_add_format_text()Jakub Zawadzki1-7/+2
Change-Id: Ie111c4db4afd0702f5a016da1547486631f571d8 Reviewed-on: https://code.wireshark.org/review/1818 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-03-25no need for if(tree)Martin Kaiser1-72/+55
Change-Id: If95ece8e2db1b650de5804465128020caf391956 Reviewed-on: https://code.wireshark.org/review/828 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-25use wmem_ascii_strdown()Martin Kaiser1-6/+4
Change-Id: Iaa7dfdc979e78f53b53f2b9a0b093873c9004f2d Reviewed-on: https://code.wireshark.org/review/827 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(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>
2013-12-21Move base64_to_tvb() to tvbuff_base64.cJakub Zawadzki1-1/+0
svn path=/trunk/; revision=54325
2013-12-14Fix [-Wmissing-prototypes]Jakub Zawadzki1-0/+3
svn path=/trunk/; revision=54095
2013-11-02Require dissector_try_string to pass a data parameter to its subdissectors. ↵Michael Mann1-2/+2
There weren't that many calls, so might as well modify the function than create a need for dissector_try_string_new. svn path=/trunk/; revision=53049
2013-11-02Fix build (missing some _U_)Alexis La Goutte1-1/+1
svn path=/trunk/; revision=53048
2013-11-02Prep a few more dissectors to receive their string data through dissector data.Michael Mann1-7/+6
svn path=/trunk/; revision=53045
2013-09-22emem -> wmem conversion:Pascal Quantin1-2/+2
- 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-15emem -> wmemPascal Quantin1-3/+3
svn path=/trunk/; revision=52063
2013-07-18Fix memleak, base64_to_tvb() strdup passed string by its own.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=50729
2013-06-29Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-2/+0
svn path=/trunk/; revision=50236
2013-03-18From beroset:Anders Broman1-10/+10
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48399
2013-01-26Use "4 space" indentation.Bill Meier1-822/+822
svn path=/trunk/; revision=47303
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-08-14more ephemeral memory cleanupMichael Mann1-6/+1
svn path=/trunk/; revision=44496
2012-06-28Update FSF address - part II.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=43538