aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-openflow.c
AgeCommit message (Collapse)AuthorFilesLines
2017-05-14Openflow: Add support of openflow 1.5 (v6)Alexis La Goutte1-0/+6
Copy from dissector 1.4 (v5) Bug: 13702 Change-Id: I2ae5b620e6ff1626c69f8fac6184244399e297de Reviewed-on: https://code.wireshark.org/review/21641 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-11-22Add prefs_get_uint_value and prefs_get_range_valueMichael Mann1-3/+1
This allows dissectors to not need to know about the internal preference structure. Change-Id: I1ae67248cd0b0132aefc225ea0a9befaf9afdde2 Reviewed-on: https://code.wireshark.org/review/18864 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-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-18/+12
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-03-20Manually add protocol dependencies derived from find_dissector.Michael Mann1-3/+3
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-01-13Use result of register_dissectorPeter Wu1-2/+1
Assign result of `register_dissector(..., func, proto)` to FOO_handle and remove `FOO_handle = create_dissector_handle(func, proto)`. Found by looking for files named packet-FOO.c having the above create_dissector_handle pattern. Some files (with different dissect routines for the two functions) remain unchanged. Change-Id: Ifbed8202c6dbc63a1dae9acc03313980ffbbbb90 Reviewed-on: https://code.wireshark.org/review/13247 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-1/+1
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c Reviewed-on: https://code.wireshark.org/review/12485 Petri-Dish: Michael Mann <mmann78@netscape.net> 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-17Remove all preferences related to enabling/disabling heuristic dissectors.Michael Mann1-12/+2
The preferences are still supported for backwards compatibility, but the heuristic_protos file has final say on the "preference" to enable/disable a heuristic dissector. Also add parameter to heur_dissector_add() for the "default" enable/disable of a heuristic dissector. With this parameter, a few more (presumably weak) heuristic dissectors have been "registered" but of course default to being disabled. Change-Id: I51bebb2146ef3fbb8418d4f5c7f2cb2b58003a22 Reviewed-on: https://code.wireshark.org/review/9610 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-12Add "user presentable" and "unique string ids" to heuristic table entries.Michael Mann1-1/+1
This allows better presentation of heuristic dissectors to the end user. Change-Id: I2ff3985ab914e83c2989880cc0c7b9904045b3f6 Reviewed-on: https://code.wireshark.org/review/9602 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-27Lua: Expose tcp_dissect_pdus() to LuaHadriel Kaplan1-1/+2
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-29OpenFlow: Capatilize O and F of OpenFlow (when use Decode as)Alexis La Goutte1-2/+2
Remove also a trailing whitespace in OpenFlow TCP port preference Change-Id: I5c3f42e634e0fee4fecf1a7f2dd1c75a68165b45 Reviewed-on: https://code.wireshark.org/review/6113 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-2/+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-24openflow; Fix a (no-effect) typo in openflow_version_values[]Bill Meier1-1/+1
Change-Id: I7a51face9c675ac3c03f2306ec40293b4835e02e Reviewed-on: https://code.wireshark.org/review/5468 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-18Eliminate proto_tree_add_text from some dissectors.Michael Mann1-2/+13
Other minor cleanup while in the neighborhood. Change-Id: I77cac916d617f56f92f686e9cd9f15fba058facf Reviewed-on: https://code.wireshark.org/review/3675 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-04Update some soft-deprecated APIs.AndersBroman1-1/+1
Change-Id: I0e255e72dd4cd9a94a4f92af409c4b34c0a266ed Reviewed-on: https://code.wireshark.org/review/1491 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-06IANA assigned port number 6653 to OpenFlow. However, applicationsFrancesco Fondelli1-11/+43
(e.g. opendaylight, nox, openvswitch, etc) still use legacy port numbers. The most common are 6633 and 6634. This patch adds a simple heuristic logic and uses the current uint preference as additional input. In most cases no user intervention is needed and OpenFlow is automatically detected/dissected. Change-Id: Iebf09b7b870efe9d52421b9acc238208d25d4565 Signed-off-by: Francesco Fondelli <francesco.fondelli@gmail.com> Reviewed-on: https://code.wireshark.org/review/921 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@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-11-18From Zoltán Lajos Kis:Anders Broman1-2/+8
Start of OpenFlow 1.4 dissector. svn path=/trunk/; revision=53405
2013-11-10From Zoltán Lajos Kis:Anders Broman1-1280/+6
Move OpenFlow v1.0 dissector out from main OpenFlow dissector. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9405 svn path=/trunk/; revision=53217
2013-11-09Add data parameter to tcp_dissect_pdus() as well as convert it to using ↵Michael Mann1-4/+5
"new" style dissectors. Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that? Should tcp_dissect_pdus return length (bytes consumed)? There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb). Seems like that could all be rolled into one. svn path=/trunk/; revision=53198
2013-11-06Add Zoltan Lajos Kis as authorMichael Mann1-0/+1
svn path=/trunk/; revision=53119
2013-11-05From Zoltán Lajos Kis:Anders Broman1-16/+31
use tcp_dissect_pdus to properly dissect messages. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9283 svn path=/trunk/; revision=53091
2013-10-29From didier gautheron: remove redundant or use faster col_xxx functionsBill Meier1-1/+1
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster. - same for replace col_append_fstr and col_append_str - remove col_clear() when it's redundant: + before a col_set/col_add if the dissector can't throw an exception. - replace col_append() after a col_clear() with faster col_add... or col_set https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9344 svn path=/trunk/; revision=52948
2013-10-23Fix warnings.Anders Broman1-0/+1
svn path=/trunk/; revision=52803
2013-10-16Remove trailing blanks; Fix some indentation;Bill Meier1-20/+23
Add editor modelines. svn path=/trunk/; revision=52653
2013-10-13As requested by Zoltán Lajos Kis, split the openflow dissector int one file ↵Anders Broman1-422/+12
per protocol version. svn path=/trunk/; revision=52593
2013-09-30Fix indent (use 4 spaces)Alexis La Goutte1-96/+96
svn path=/trunk/; revision=52286
2013-09-30Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-1/+1
svn path=/trunk/; revision=52285
2013-09-28Start dissect multipart messages.Anders Broman1-7/+81
svn path=/trunk/; revision=52237
2013-09-27Fix:Jörg Mayer1-18/+17
/home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-openflow.c: In function ‘dissect_openflow_v_1_3’: /home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-openflow.c:1125:18: error: variable ‘version’ set but not used [-Werror=unused-but-set-variable] guint8 type, version; Remove some trailing whitespace. svn path=/trunk/; revision=52228
2013-09-26Fix:Anders Broman1-4/+6
packet-openflow.c:577:31: error: "/*" within comment packet-openflow.c:655:24: error: "/*" within comment cc1: warnings being treated as errors packet-openflow.c: In function 'dissect_openflow_features_reply_v1_3': packet-openflow.c:671: warning: unused parameter 'pinfo' packet-openflow.c:671: warning: unused parameter 'length' packet-openflow.c: In function 'dissect_openflow_multipart_request_v1_3': packet-openflow.c:809: warning: unused parameter 'pinfo' packet-openflow.c:809: warning: unused parameter 'length' packet-openflow.c: At top level: packet-openflow.c:1033: warning: return type defaults to 'int' packet-openflow.c:1119: warning: return type defaults to 'int' svn path=/trunk/; revision=52226
2013-09-26Start refactoring to dissect each version separatly.Anders Broman1-107/+450
svn path=/trunk/; revision=52223
2013-09-03Fix "malformed packet" and tidy up a bit.Anders Broman1-3/+16
svn path=/trunk/; revision=51740
2013-09-03Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+2
svn path=/trunk/; revision=51737
2013-09-02Fix compilation with Linux packet-openflow.c: In function ↵Alexis La Goutte1-4/+2
'dissect_openflow_pkt_out': packet-openflow.c:663:13: error: variable 'actions_len' set but not used [-Werror=unused-but-set-variable] And make fix-encoding-args happy svn path=/trunk/; revision=51651
2013-09-02FixAnders Broman1-1/+2
packet-openflow.c:318: warning: return type defaults to 'int' packet-openflow.c: In function 'dissect_openflow_ofp_match_v_1_0': packet-openflow.c:350: warning: control reaches end of non-void function svn path=/trunk/; revision=51650
2013-09-02Dissect more of openflow.Anders Broman1-5/+361
svn path=/trunk/; revision=51649
2013-09-01dissect OFPT_PACKET_IN.Anders Broman1-3/+125
svn path=/trunk/; revision=51633
2013-07-15Fix warnings found by fix-encoding-args tools.(and remove some tabs also)Alexis La Goutte1-32/+32
svn path=/trunk/; revision=50623
2013-07-15Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+1
svn path=/trunk/; revision=50621
2013-07-15Update dissection.Anders Broman1-43/+37
svn path=/trunk/; revision=50604
2013-07-11Fix cut-and-pasteo found by a compiler warning.Guy Harris1-7/+7
Mark an unused parameter as unused. svn path=/trunk/; revision=50515
2013-07-11The beginning of an openflow dissector.Anders Broman1-0/+945
svn path=/trunk/; revision=50513