aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-9p.c
AgeCommit message (Collapse)AuthorFilesLines
2016-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-1/+1
This patch introduces new APIs to allow dissectors to have a preference for a (TCP) port, but the underlying data is actually part of Decode As functionality. For now the APIs are intentionally separate from the regular APIs that register a dissector within a dissector table. It may be possible to eventually combine the two so that all dissectors that register with a dissector table have an opportunity to "automatically" have a preference to adjust the "table value" through the preferences dialog. The tcp.port dissector table was used as the guinea pig. This will eventually be expanded to other dissector tables as well (most notably UDP ports). Some dissectors that "shared" a TCP/UDP port preference were also converted. It also removed the need for some preference callback functions (mostly when the callback function was the proto_reg_handoff function) so there is cleanup around that. Dissectors that has a port preference whose default was 0 were switched to using the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference Also added comments for TCP ports used that aren't IANA registered. Change-Id: I99604f95d426ad345f4b494598d94178b886eb67 Reviewed-on: https://code.wireshark.org/review/17724 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-26conversation: rename shadow variableDario Lombardo1-3/+3
Change-Id: I8f738b2e01d7f448b21cdc1b488b16b7dd581911 Reviewed-on: https://code.wireshark.org/review/16104 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-149p: change glib functions into wmem calls.Dario Lombardo1-40/+16
Change-Id: I24fc7a52d30aa28f60b0e00a972e01c56c8f63a4 Reviewed-on: https://code.wireshark.org/review/14889 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-03-20Create call_data_dissector() to call data dissector.Michael Mann1-7/+2
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-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-2/+2
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>
2016-01-08Fix a lot of typos and misspellingsmoshekaplan1-4/+4
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-07-03Split init routine into init/cleanup for more dissectorsPeter Wu1-10/+7
This patch converts some dissectors using g_hash_table_foreach_remove. - 9p: drop no-op free func. - nfs: use g_hash_table_new_full such that a destructor function can be used. Drop NULL check since g_free can handle these just fine. - nlm: use g_hash_table_new_full such that a destructor function can be used. Simplify "matched" destruction by replacing the wrapper by a direct g_free call. Change-Id: I455e7f0ad4e47e70dae05af7233fdcdebf583f9f Reviewed-on: https://code.wireshark.org/review/9224 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-27Lua: Expose tcp_dissect_pdus() to LuaHadriel Kaplan1-2/+3
Provide a way for Lua-based dissectors to invoke tcp_dissect_pdus() to make TCP-based dissection easier. Bug: 9851 Change-Id: I91630ebf1f1fc1964118b6750cc34238e18a8ad3 Reviewed-on: https://code.wireshark.org/review/6778 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2014-12-22First batch of unincludes. Last attempt...Martin Mathieson1-4/+0
Change-Id: I3681462aeb98ca62ed3ec5eb226b2553317391a9 Reviewed-on: https://code.wireshark.org/review/5997 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-11-29Use proto_tree_add_bitmask for groups of proto_tree_add_boolean.Michael Mann1-20/+9
Part 1 of many Change-Id: I77a5789ac23388e6a5f8098dc398592f39638124 Reviewed-on: https://code.wireshark.org/review/5532 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-10-06Adjust indentation to match editor modelines; Do other minor whitespace changes.Bill Meier1-1/+1
Change-Id: Ic020b2c92db5d14a2be9dc4d35aef4514b8b0353 Reviewed-on: https://code.wireshark.org/review/4502 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-209P2000.L also has the UID field in tattach.Guy Harris1-3/+11
See, for example: http://code.google.com/p/diod/wiki/protocol#attach,_auth_--_messages_to_establish_a_connection and http://code.google.com/p/diod/wiki/protocol#Overview where the latter says 9P2000.L consists of a subset of the canonical 9P2000 operations, the 9P2000.u attach and auth messages, plus new operations designed to map to the Linux VFS in a straightforward way. so tattach and tauth are the same as 9P2000.u. Don't throw a dissector assertion of there's data at the end of the packet; in the particular case that found this bug, yes, it was a dissector bug, but it could also be a malformed packet, and we should not throw dissector assertions unless we know *for certain* that the problem is a dissector bug rather than a malformed packet. Change-Id: I5ef5d837bccb4e7c4844d31a138aa55a85ec1b60 Reviewed-on: https://code.wireshark.org/review/3758 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-03Eliminate proto_tree_add_text from some dissectors.Michael Mann1-33/+46
Change-Id: Ib6024307e85d6c23decf40e9759f549c19ffe136 Reviewed-on: https://code.wireshark.org/review/3318 Petri-Dish: Michael Mann <mmann78@netscape.net> Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-059p: fix version detection, fix dissect_9P retvalPeter Wu1-176/+105
Fix version detection (detect against full string instead of prefix), properly dissect Tcreate extension field (9p2000.u only), dissect Tunlinkat flags (9p2000.L). Refactor pattern to dissect string[s] types for DRY. Convert to use tcp_dissect_pdus. I have not seen a fragmented case, but maybe that may happen in the future. The main motivation for touching 9p was that it returns bogus values for some types. This has been fixed by properly increasing offset, and always return the captured length. Change-Id: If2184204ae9c853b94aca8ade3763d7fe523fa86 Reviewed-on: https://code.wireshark.org/review/2836 Reviewed-by: Christopher Maynard <Christopher.Maynard@gtech.com> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-22convert to proto_tree_add_subtree[_format]Michael Mann1-3/+3
Change-Id: I358bfaa4e5d40cd01b766f614f8bd0dbaf611dd0 Reviewed-on: https://code.wireshark.org/review/2508 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-17Fix copy/paste errors in value_string.Jakub Zawadzki1-1/+1
Also make repetition_coding_indications[] standard terminated. Change-Id: Ice20e1f27f5ab4d111f893608a230b83899efc9f Reviewed-on: https://code.wireshark.org/review/2288 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Evan Huus <eapache@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>
2014-01-21The file's name has a lower-case "p" in "9p".Guy Harris1-1/+1
svn path=/trunk/; revision=54880
2014-01-21Always combine ENC_UTF_8 with ENC_NA.Guy Harris1-6/+6
svn path=/trunk/; revision=54878
2014-01-219p strings are, not surprisingly, encoded using UTF-8; replaceGuy Harris1-6/+6
tvb_get_string() calls with tvb_get_string_enc() calls explicitly specifying UTF-8. svn path=/trunk/; revision=54876
2014-01-15Don't cast away constness.Guy Harris1-1/+1
svn path=/trunk/; revision=54814
2013-12-19Remove 'L' and 'LL' from constants; they are all used as 32-bit quantities.Bill Meier1-29/+31
#if 0 an unsed constant definition. svn path=/trunk/; revision=54269
2013-12-08Fix some warnings: cast discards `__attribute__((const))' qualifier from ↵Jakub Zawadzki1-1/+1
pointer target type svn path=/trunk/; revision=53875
2013-11-21Constify two vars;Bill Meier1-280/+293
Add editor modelines; Rework some whitespace. svn path=/trunk/; revision=53482
2013-09-22emem -> wmem conversion:Pascal Quantin1-6/+6
- 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-21Add _g_ to the names of functions that allocate glib memory. This is a bit moreEvan Huus1-6/+6
explicit, and frees up the "generic" names (like tvb_memdup) for new signatures that take the appropriate wmem pool. Majority of the conversion done with sed. svn path=/trunk/; revision=52164
2013-08-10Fix (-W)documentation error found by ClangAlexis La Goutte1-5/+5
packet-9p.c:342:16: error: not a Doxygen trailing comment [-Werror,-Wdocumentation] guint16 len; /*< Length of the string */ ^~~ /**< packet-9p.c:343:13: error: not a Doxygen trailing comment [-Werror,-Wdocumentation] char *str; /*< The string */ ^~~ /**< packet-9p.c:364:15: error: not a Doxygen trailing comment [-Werror,-Wdocumentation] guint8 type; /*< Type */ ^~~ /**< packet-9p.c:365:19: error: not a Doxygen trailing comment [-Werror,-Wdocumentation] guint32 version; /*< Monotonically incrementing version number */ ^~~ /**< packet-9p.c:366:16: error: not a Doxygen trailing comment [-Werror,-Wdocumentation] guint64 path; /*< Per-server-unique ID for a file system element */ ^~~ /**< 5 errors generated svn path=/trunk/; revision=51260
2013-08-01From Dominique Martinet via ↵Jeff Morriss1-339/+472
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8787 : Follow-up on 9P dissector enhancement ( https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8589 ) "fid"s, 9P file descriptors, are valid from the moment it's allocated until when it's freed. My original patch kept a fid hashtable updated everytime a packet was dissected in full-view (with a non-null tree) Attached is a patch that builds a tree for each 9P fid and stores the corresponding path when it becomes valid/marks it as invalid when it no longer is. svn path=/trunk/; revision=51092
2013-07-15Fix warnings: comma at end of enumerator list.Chris Maynard1-2/+2
svn path=/trunk/; revision=50640
2013-05-18Add some casts for C++ compatibility.Guy Harris1-6/+7
Make conv_get_fid() return a "const char *", as it can return a string constant, and they are usually *not* writable. svn path=/trunk/; revision=49400
2013-05-18A "pointer to something" is a "void *", not a "char *". Using "void *"Guy Harris1-2/+2
avoids some alignment warnings from clang. svn path=/trunk/; revision=49399
2013-05-17Fix some more warnings that show up on platforms with 32-bit time_t.Guy Harris1-12/+12
Get rid of double semicolons. svn path=/trunk/; revision=49371
2013-05-17Squelch more warnings about empty structures.Anders Broman1-1/+12
svn path=/trunk/; revision=49366
2013-05-17Squelch warnings about empty structures and chopping off 64-bit valuesGuy Harris1-13/+22
at 32 bits. svn path=/trunk/; revision=49364
2013-05-17From Dominique Martinet via ↵Jeff Morriss1-201/+2006
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8589 : Theses patches add alot of new message types for the 9P protocol and its extensions (most specifically 9P2000.L), while staying compatible with the legacy protocol (hence the hashtable with conversation information, since version is only known at handshake) It is still missing alot of 9P2000.u specifics, but I don't have any server to test it with. I'm also missing some dump to test legacy, but I'm pretty confident I didn't break much there as it is mostly compatible, most differences are handled using different messages, the only one that was changed would be RERROR. second diff also adds deeper interpretation of the protocol, by following the conversation stream and keeping a bigger hashtable associating fid (file handles) and file names, for easier debugging. From me: roll the contents of the (new) packet-9p.h back into the C file. svn path=/trunk/; revision=49363
2013-03-12svn path=/trunk/; revision=48272Anders Broman1-2/+2
2013-03-12- [-Wmissing-prototypes]Anders Broman1-0/+4
- explicit casts. svn path=/trunk/; revision=48265
2013-02-05Add missing hf[] entries found by checkhf.Bill Meier1-0/+9
ERROR: NO ARRAY: packet-9p.c, hf_9P_dm_exec_group ERROR: NO ARRAY: packet-9p.c, hf_9P_dm_read_group ERROR: NO ARRAY: packet-9p.c, hf_9P_dm_write_group svn path=/trunk/; revision=47493
2012-09-23Fix some unused variable warnings from GCC.Evan Huus1-2/+0
svn path=/trunk/; revision=45064
2012-09-23replaced decode_boolean_bitfield calls with itemized filtersMichael Mann1-58/+96
svn path=/trunk/; revision=45059
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45017
2012-09-10Initial commit to support yet another method of passing data between dissectors.Jakub Zawadzki1-1/+1
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL svn path=/trunk/; revision=44860
2012-08-10Use val_to_str_const() where appropriate;Bill Meier1-22/+24
Also (for a few files): - create/use some extended value strings; - remove unneeded #include files; - remove unneeded variable initialization; - re-order fcns slightly so prefs_reg_handoff...() at end, etc svn path=/trunk/; revision=44438
2012-06-28Update FSF address - part II.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=43538
2012-03-01Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-4/+5
svn path=/trunk/; revision=41261
2012-01-18Fix some duplicate display filter names.Chris Maynard1-1/+1
svn path=/trunk/; revision=40568
2011-10-15Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, ↵Bill Meier1-16/+16
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-11Fix benign bugs wherein proto_tree_add_uint() was intended instead of ↵Bill Meier1-1/+1
proto_tree_add_item(); (Replaces changes made in SVN #39351). svn path=/trunk/; revision=39361