aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-smb-pipe.c
AgeCommit message (Collapse)AuthorFilesLines
2017-05-20Show structures as FT_NONE, not FT_STRING.Guy Harris1-17/+34
Change-Id: I51577b6a92ff2401671065b1e6313db9a438c675 Reviewed-on: https://code.wireshark.org/review/21718 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-17Create temporary variables for some proto_tree_add_<datatype> calculations.Michael Mann1-4/+4
checkAPIs.pl doesn't like tvb_get_* parameters because it thinks proto_tree_add_item should be used. This is just to pacify the check. Change-Id: If40728bcdf5558c351999057321ffba5d802c7c7 Reviewed-on: https://code.wireshark.org/review/21694 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-04-19smb-pipe: fix memory leaks from descriptorsPeter Wu1-3/+3
The values from the requests are used in a later response, so use the packet capture file scope instead. Bug: 13615 Change-Id: I480d9dbdc20c64eabea092065245d8687b7fc39f Reviewed-on: https://code.wireshark.org/review/21211 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-29Register reassembly tablesMichael Mann1-22/+9
Register all reassembly tables with a central unit, allowing the central unit to have the callback that initializes and destroys the reassembly tables, rather than have dissectors do it individually. Change-Id: Ic92619c06fb5ba6f1c3012f613cae14982e101d4 Reviewed-on: https://code.wireshark.org/review/19834 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-27tvb_get_string_enc + proto_tree_add_item = proto_tree_add_item_ret_stringMichael Mann1-8/+2
Also some other tricks to remove unnecessary tvb_get_string_enc calls. Change-Id: I2f40d9175b6c0bb0b1364b4089bfaa287edf0914 Reviewed-on: https://code.wireshark.org/review/16158 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>
2016-05-09Give the time_[m]secs_to routines names that begin with "[un]signed_".Guy Harris1-3/+3
Indicate whether they take a signed time delta or an unsigned time delta. Export unsigned_time_secs_to_str() while we're at it. Change-Id: I0fbe87f1825efa886364caa61a3358b79d285947 Reviewed-on: https://code.wireshark.org/review/15324 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-03-20Create call_data_dissector() to call data dissector.Michael Mann1-11/+1
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-17Associate dissector tables and heuristic subdissector lists with a protocol.Michael Mann1-9/+4
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-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-1/+1
That removes most of the uses of the frame number field in the frame_data structure. Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22 Reviewed-on: https://code.wireshark.org/review/13509 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-25MSWSP: Initial implementation of MS-WSP (windows search protocol) dissectorGregor Beck1-8/+8
This changeset is a forward port of Gregors ms-wsp branch from his repo http://repo.or.cz/w/wireshark-wip.git. Most of the messages of the MS-WSP protocol are implemented here and as such consists of the majority of the changes for the dissector. In addition to the forward porting Gregors work I added some extra bits 1) cater for SMB2 Read Response and Write Request msgs that can also contain MSWSP messages 2) update property specifications with info extracted from MS-WSP protocol doc 3) store some basic data about previously seen messages that are needed for dissecting CPMGetRows request 4) expand/update dissect_CPMSetBindings & parse_CTableColumn routines 5) parse and store CTableColumn & CPMSetBindingsIn structures in conversation related data for use later. 6) fully dissect/parse SeekDesciption of CPMGetRowsOut 7) dissect CPMGetRows out message specifically the Rows & Columns 8) flesh out the boolean properties of uBooleanOptions field 9) flesh out various other dissectors: CPMRatioFinished CPMRestartPosition CPMCompareBmkIn/CPMCompareBmkOut CPMGetApproximatePosition CPMGetSendNotifyOut FindIndicesIn/Out FetchValue Bug: 11321 Change-Id: I68b5c2f3e63874c1dbb271feab89b2b8aa65ac39 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-on: https://code.wireshark.org/review/9440 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-07-03Call reassembly_table_destroy for some dissectorsPeter Wu1-0/+7
This patch adds reassembly_table_destroy calls as cleanup function for dissectors which have a simple init routine that just calls reassembly_table_init (comments are ignored). The changes were automatically generated using https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=4cc0aec05dc67a51926a045e1955b7a956757b5e (with the if and assignment parsers disabled). The only difference from the autogenerated output is that the XXX comments from the init routines in smb-pipe and tds dissectors are kept. Change-Id: I64aedf7189877247282b30b0e0f83757be6199e7 Reviewed-on: https://code.wireshark.org/review/9222 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-22Remove a bunch of deprecated tvb_length callsEvan Huus1-4/+4
Change-Id: I9362e0fdc4519ba5f3d656152966e7030f478839 Reviewed-on: https://code.wireshark.org/review/9022 Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-08Eliminate proto_tree_add_text from some dissectors.Michael Mann1-15/+39
"file" dissectors are now rid of proto_tree_add_text. Change-Id: I4e0f7248135e6ce194fcafde47e538db84b964aa Reviewed-on: https://code.wireshark.org/review/8828 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-19The times in question are local, not UTC.Guy Harris1-8/+26
Revert to the older code, but just show the time as "Not representable" if gmtime() fails. Change-Id: I435facc042e3ca35fb07292a4b2657ccdfd02abb Reviewed-on: https://code.wireshark.org/review/6672 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-19smb-pipe: prevent possible crash; gmtime() can return NULL.Bill Meier1-18/+8
For FT_ABSOLUTE_TIME fields: Instead of calling gmtime()/mktime() to convert a time to UTC time which is then displayed using proto_tree_add_time(), Use ABSOLUTE_TIME_UTC as the 'display' value for the field and then display the field using proto_tree_add_item(). Change-Id: I1926c40de76a86072437902cb7621d3873827b11 Reviewed-on: https://code.wireshark.org/review/6659 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-01-07tvb_bytes_to_ep_str -> tvb_bytes_to_strMichael Mann1-5/+5
Change-Id: I79c613cbdd8dc939dd4c29ebc477fb6eefd5bfc4 Reviewed-on: https://code.wireshark.org/review/6371 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-25Deleting unnecessary #includes from dissectors.Martin Mathieson1-3/+0
Fifth batch (packet-rtp.c -> end). Will look at cleaning up and committing script afterwards. Change-Id: I8ed61dc941d98d3f7259a9d1f74e214eb7b4bfa2 Reviewed-on: https://code.wireshark.org/review/6052 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-4/+2
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-21Have a heur_dissector_list_t be an opaque handle.Guy Harris1-1/+1
This allows dissector lists to be looked up by name, so they can be shared by multiple dissectors. (This means that there's no "udplite" heuristic dissector list, but there shouldn't be one - protocols can run atop UDP or UDPLite equally well, and they share a port namespace and uint dissector table, so they should share a heuristic dissector table as well.) Change-Id: Ifb2d2c294938c06d348a159adea7a57db8d770a7 Reviewed-on: https://code.wireshark.org/review/5936 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-13Use ENC_LITTLE_ENDIAN when fetching FT_U?INT8 fields ...Bill Meier1-1/+1
(for some dissectors which fetch all other integral fields using ENC_LITTLE_ENDIAN). Change-Id: Ica72a68ac560f2920d61e0769de83130557c46fd Reviewed-on: https://code.wireshark.org/review/5752 Reviewed-by: Bill Meier <wmeier@newsguy.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-16Fix spelling: cant-->can't, wont-->won't, etcBill Meier1-4/+4
Change-Id: I4497f1b8b6eab0e576d9dd31b732965f9a6679c6 Reviewed-on: https://code.wireshark.org/review/4124 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-11Make all "padding" fields filterableMichael Mann1-1/+6
Change-Id: Ic4e4d9142a9b05ef3b628fac2e8766014c5fccec Reviewed-on: https://code.wireshark.org/review/4073 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-09convert to proto_tree_add_subtree[_format]Michael Mann1-13/+4
Change-Id: I8d66b1bc7dbdfee3d4bf6fd3b3c21c6323b66f44 Reviewed-on: https://code.wireshark.org/review/2946 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-4/+4
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-4/+4
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-16Convert a bunch of time_to_str functions to wmemEvan Huus1-3/+3
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983 Reviewed-on: https://code.wireshark.org/review/2245 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-21Change the signature of dissector_try_heuristic() to return hdtbl_entryAndersBroman1-6/+8
which can be used to call the found heuristic dissector on the next pass. Introduce call_heur_dissector_direct() to be used to call a heuristic dissector which accepted the frame on the first pass. Change-Id: I524edd717b7d92b510bd60acfeea686d5f2b4582 Reviewed-on: https://code.wireshark.org/review/1697 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
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-19Rename more to_str functions to have ep_ in the name if they return ephemeralEvan Huus1-3/+3
buffers. Remove two unused functions. svn path=/trunk/; revision=54250
2013-12-19Rename a couple of to_str functions to have ep_ in the name. This makes itEvan Huus1-5/+5
obvious that the returned string is ephemeral, and opens up the original names in the API for versions that take a wmem pool (and thus can work in any scope). svn path=/trunk/; revision=54249
2013-12-11- Make local functions static.Anders Broman1-0/+5
- Forward declaration of register functions. svn path=/trunk/; revision=53941
2013-11-27- Create/use several extended value_stringsBill Meier1-9/+22
(sort associated value_string arrays as needed); - Use new VALUE_STRING_LIST mechanism/macros to create enums and value_string arrays for: WERR_errors, DOS_errors, SRV_errors, and HRD_errors; - Declare certain global value_string arrays as static (local) and use global extended value_strings to reference same; (e.g., ms_coiuntry_codes value_string_array) - Rename SMBE_... defs used in several different value_string arrays to prevent potential name collisions: ( e.g., for SRV_errors: SMBE_... ==> SMBE_SRV_...) Done for value_string arrays: DOS_errors, SRV_errors, HRD_errors; - WERR_errors value_string array: Note that WERR associated defs no longer exist in the latest samba doserr.h. (The WERR_errors defs were originally generated from the samba doserr.h). For now: WERR_errors kept as is. - ToDo: Fix PIDL-generated dcerpc dissectors to use NT_errors_ext and WERR_errors_ext extended value_strings. - Add editor modelines to a few files. - Make whitespace changes. svn path=/trunk/; revision=53614
2013-11-25Move DCERPC data in packet_info needed for Decode As into packet scoped ↵Michael Mann1-3/+3
proto data. svn path=/trunk/; revision=53559
2013-11-10Add missing includes in order to remove exceptions.h from proto.h (next commit).Jakub Zawadzki1-0/+2
svn path=/trunk/; revision=53230
2013-11-09Include <epan/to_str.h> only when needed.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53189
2013-10-26Mark a bunch of no-longer-used parameters as unused. Remove a couple ofJeff Morriss1-2/+2
unused parameters. svn path=/trunk/; revision=52860
2013-10-25Remove SMB's use of private_data and just pass the data through all of the ↵Michael Mann1-78/+68
dissection functions svn path=/trunk/; revision=52856
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-08-17Get rid of an unused variable.Guy Harris1-20/+8
For some routines, instead of having them check for -1 as the hf_index and using a default hf_index in that case, just pass them the default hf_index instead of -1 and just use the hf_index unconditionally. svn path=/trunk/; revision=51399
2013-08-16Fix typo (failure to remove a %).Guy Harris1-143/+155
_U_ify some no-longer-used arguments. Rename all the hf_pipe variables to hf_smb_pipe, and rename the field names and protocol name to be "smb_pipe.", for consistency. (Ceci n'est pas une pipe.) Treat and label 1-byte parameters as "byte parameters" and multi-byte opaque parameters as "bytes parameters". Format machine-added hf[] entries to match other hf[] entries. Fix indentation. svn path=/trunk/; revision=51398
2013-08-16Make more filterable items courtesy of convert_proto_tree_add_text.pl.Michael Mann1-133/+111
Also converted proto_tree_add_xxx_format into proto_tree_add_xxx_format_value so that label doesn't get out of sync with hf. svn path=/trunk/; revision=51394
2013-07-17Remove fragment_data, add fragment_head, fragment_item - for now alias it to ↵Jakub Zawadzki1-1/+1
the same structure. This is begin of work to split fragment head and fragments items. svn path=/trunk/; revision=50708
2013-07-14Rewrite reassemble API to use TVBs instead of raw data.Jakub Zawadzki1-4/+2
(it seems to be working for TCP ^^) svn path=/trunk/; revision=50580
2013-06-14Remove check_col() and the occasional tree.Michael Mann1-18/+11
svn path=/trunk/; revision=49923
2013-03-22Don't wire into the reassembly code the notion that reassemblies shouldGuy Harris1-14/+19
be done on flows from one address to another; reassembly for protocols running atop TCP should be done on flows from one TCP endpoint to another. We do this by: adding "reassembly table" as a data structure; associating hash tables for both in-progress reassemblies and completed reassemblies with that data structure (currently, not all reassemblies use the latter; they might keep completed reassemblies in the first table); having functions to create and destroy keys in that table; offering standard routines for doing address-based and address-and-port-based flow processing, so that dissectors not needing their own specialized flow processing can just use them. This fixes some mis-reassemblies of NIS YPSERV YPALL responses (where the second YPALL response is processed as if it were a continuation of a previous response between different endpoints, even though said response is already reassembled), and also allows the DCE RPC-specific stuff to be moved out of epan/reassembly.c into the DCE RPC dissector. svn path=/trunk/; revision=48491
2013-03-18From beroset:Anders Broman1-7/+7
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48400
2013-02-22Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-23/+1
svn path=/trunk/; revision=47823
2013-01-31Comment out unused hf[] entries & etc.Bill Meier1-1/+3
(found by checkhf) svn path=/trunk/; revision=47389