aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mbtcp.c
AgeCommit message (Collapse)AuthorFilesLines
2014-08-14Eliminate proto_tree_add_text from some dissectors.Michael Mann1-9/+29
Other minor cleanup while in the neighborhood. Change-Id: If73a029f564219782c313d4154c24c7ce7458b52 Reviewed-on: https://code.wireshark.org/review/3574 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-07-04convert to proto_tree_add_subtree[_format]Michael Mann1-19/+13
Change-Id: I621f2e2cad9403449cb78f45302388f0c874d3bc Reviewed-on: https://code.wireshark.org/review/2852 Reviewed-by: Michael Mann <mmann78@netscape.net>
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-07tvb_new_subset -> tvb_new_subset_length when length parameters are equal.Michael Mann1-2/+2
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-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-17Bugfix OpenSafety "heuristics" to only consider a packet "handled" if a ↵Michael Mann1-4/+0
subdissector is called. Fixes bug 9572 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9572) Also removed tree check in Modbus dissector because dissector_try_string() is being called under it. #BACKPORT(1.10) svn path=/trunk/; revision=54193
2013-12-14Fix [-Wmissing-prototypes]Jakub Zawadzki1-4/+5
svn path=/trunk/; revision=54095
2013-11-23Create the ability to have packet scoped "proto" data. Bug 9470 ↵Michael Mann1-11/+11
(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-09Add data parameter to tcp_dissect_pdus() as well as convert it to using ↵Michael Mann1-8/+10
"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-02Require dissector_try_string to pass a data parameter to its subdissectors. ↵Michael Mann1-1/+1
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-09-15emem -> wmemPascal Quantin1-2/+3
svn path=/trunk/; revision=52063
2013-09-09Change some internal dissector table UI names so it's clear which protocol ↵Chris Maynard1-1/+1
they pertain to and it's easier to find in the list. svn path=/trunk/; revision=51904
2013-09-09expert_add_info_format_text -> expert_add_info_formatMichael Mann1-1/+1
svn path=/trunk/; revision=51852
2013-08-05Keep result of [new_]register_dissector in some dissectors. [2 of x]Jakub Zawadzki1-18/+7
(don't create new dissector handle if we can use already existing one) svn path=/trunk/; revision=51159
2013-08-01From Chris Bontje via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9001 :Jeff Morriss1-15/+43
Some small improvements to the Modbus Dissector: - Better detection of query/response w/ serial line Modbus RTU - Smallest Modbus RTU message can actually be 6 bytes, not 8. - Only check 16/32-bit register decoding options with appropriate function codes svn path=/trunk/; revision=51083
2013-06-14Removed check_col() and the occasional tree.Michael Mann1-86/+80
svn path=/trunk/; revision=49938
2013-05-27Batch of filterable expert infosMichael Mann1-2/+19
svn path=/trunk/; revision=49596
2013-05-12Add the posibillity to use a key for per-packet-data.Anders Broman1-11/+11
svn path=/trunk/; revision=49259
2013-03-19From beroset:Anders Broman1-3/+3
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48425
2013-02-26it's ==> its & its ==> it's as needed.Bill Meier1-2/+2
svn path=/trunk/; revision=47891
2013-01-14Avoid any possibility of an infinte loop. Fixes Coverity CID 739883: ↵Chris Maynard1-16/+18
Infinite loop. (Minor whitespace cleanup also.) svn path=/trunk/; revision=47076
2012-10-31Add CRC verification to Modbus RTU dissector. CRC algorithm is the same as ↵Michael Mann1-4/+18
the "crc16-plain" with a different initial CRC (0xFFFF instead of 0). Created crc16_plain_tvb_offset_seed to "replace" crc16_plain_tvb_offset, but didn't remove crc16_plain_tvb_offset for backwards compatibility worries. Updated only dissector that used crc16_plain_tvb_offset (profinet/packet-pn-rt.c) to use crc16_plain_tvb_offset_seed(..., 0) svn path=/trunk/; revision=45854
2012-10-26Fix copy/paste errorPascal Quantin1-2/+2
svn path=/trunk/; revision=45795
2012-10-26Fix [-Werror=sign-compare] [-Wunused-but-set-variable]Anders Broman1-6/+6
svn path=/trunk/; revision=45794
2012-10-26Improve Modbus/TCP dissector, Part 1Michael Mann1-228/+783
This is a portion of the patch supplied in bug 7902 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7902). Breaking the functionality up into smaller chunks. This definitively breaks the Modbus dissection into 3 dissectors: Modbus - real protocol PDU Modbus/TCP - Encapsulation of Modbus over TCP (with a small header before PDU) Modbus RTU - Originally an encapsulation of Modbus over serial (with smaller header + CRC), but can also be sent over TCP. General cleanup/refactoring (including display filter names) based on the 3 dissectors. Also included: 1. Enhanced dissection to include preferences for register data to be dissected as UINT16, UINT32 or FLOAT 2. Dynamic port registration 3. Additional fields now filterable svn path=/trunk/; revision=45793
2012-10-11Change 'for (i=1; i<=n;...' to 'for (i=0; i<n; ...)'Bill Meier1-11/+11
Done on general principles altho upon inspection none of the cases changed would have actually resulted in an infinite loop. svn path=/trunk/; revision=45478
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-3/+3
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-7/+7
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-08-10convert some simple uses to use ephemeral memoryMichael Mann1-7/+4
svn path=/trunk/; revision=44413
2012-06-28Update FSF address - part II.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=43538
2012-01-04From Michael Mann via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6697Alexis La Goutte1-1/+1
Modbus object support for CIP dissector Support for the Modbus object within the CIP dissector. Essentially wraps the Modbus protocol within a CIP object. Also included update to Modbus error code per http://www.wireshark.org/lists/wireshark-dev/201111/msg00187.html svn path=/trunk/; revision=40371
2011-10-06Convert 'encoding' parameter of certain proto_tree_add_item() calls in ↵Bill Meier1-55/+55
non-autogenerated epan/dissectors: Specifically: Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as the encoding parameter for proto_tree_add_item() calls which directly reference an item in hf[] which has a type of: FT_UINT8 FT_UINT16 FT_UINT24 FT_UINT32 FT_UINT64 FT_INT8 FT_INT16 FT_INT24 FT_INT32 FT_INT64 FT_FLOAT FT_DOUBLE svn path=/trunk/; revision=39288
2011-07-09Put Modbus/UDP support back.Guy Harris1-1/+27
svn path=/trunk/; revision=37947
2011-06-06From Roland Knall:Anders Broman1-1/+4
Modbus/TCP: Calculating the drop-out criteria for special data dissection fails. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5997 svn path=/trunk/; revision=37566
2011-06-05Clean up indentation.Guy Harris1-1046/+1045
svn path=/trunk/; revision=37547
2011-06-04Try to pacify the OSX build bot.Anders Broman1-2/+2
svn path=/trunk/; revision=37542
2011-06-04Try to fix part of the build bot errors.Anders Broman1-8/+5
svn path=/trunk/; revision=37541
2011-06-04From Michael Mann:Anders Broman1-475/+973
I made the following improvements to the Modbus/TCP dissector: 1. Implemented protocol to the latest specification (v1.1b). See http://www.modbus.org/specs.php. 2. Upgraded to "tcp_dissect_pdus" instead of having the dissector do it manually. This also provides TCP packet reassembly support. 3. Removed support for UDP port 502 because it's not supported by the protocol specification. I believe "Decode As..." could be used in its place. 4. Added dissector support for the following function codes: a) 8 - Diagnostics b) 11 - Event Counter c) 12 - Event Log d) 43 - Encapsulation Transport (mostly for 43/14) 5. Removed support for function codes not in the protocol specification. None of them were really being parsed, they just offered a "name" for the function code. 6. Moved protocol #defines to header file for access from other dissectors. I plan to have other dissectors use this, but one patch at a time. 7. Created "modbus" dissector that is accessible to other dissectors. 8. Renamed base "display filter name" to reflect PROTOABBREV. I removed defines for value_strings, I think it's better to export the vaöue strings if needed. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5923 svn path=/trunk/; revision=37539
2011-04-28From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5786 :Jeff Morriss1-88/+120
This patch registers a dissector table to allow other dissectors to register as subdissectors for modbus/tcp data. Additionally it registers the dissector, so it can be invoked by another dissector by name. Additionally this version of the patch adds the Data field not as a text field, but rather as a field which can be selected and tested for by name. svn path=/trunk/; revision=36925
2010-12-20Rename the routines that handle dissector tables with unsigned integerGuy Harris1-2/+2
keys to have _uint in their names, to match the routines that handle dissector tables with string keys. (Using _port can confuse people into thinking they're intended solely for use with TCP/UDP/etc. ports when, in fact, they work better for things such as Ethernet types, where the binding of particular values to particular protocols are a lot stronger.) svn path=/trunk/; revision=35224
2010-04-06#include <string.h> not needed.Bill Meier1-1/+0
svn path=/trunk/; revision=32410
2010-04-03Remove unneeded #include <stdio.h>Bill Meier1-1/+0
svn path=/trunk/; revision=32367
2009-08-09Don't guard col_clear with col_checkKovarththanan Rajaratnam1-2/+1
svn path=/trunk/; revision=29344
2009-08-09Don't guard col_set_str (COL_PROTOCOL) with col_checkKovarththanan Rajaratnam1-2/+1
svn path=/trunk/; revision=29340
2009-06-18From Kovarththanan Rajaratnam via bug 3548:Stig Bjørlykke1-19/+19
(1) Trailing/leading spaces are removed from 'name's/'blurb's (2) Duplicate 'blurb's are replaced with NULL (3) Empty ("") 'blurb's are replaced with NULL (4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME, FT_PROTOCOL, FT_STRING and FT_STRINGZ field types (5) Only allow non-zero value for 'display' if 'bitmask' is non-zero svn path=/trunk/; revision=28770
2008-11-19From Joakim Wiberg:Jaap Keuter1-10/+9
This patch allows the ModbusTCP dissector (packet-mbtcp.c) to decode ModbusUDP packets. Essentially this is the same packets over UDP instead of TCP. ModbusUDP isn't an official part of the ModbusTCP specification but used by several vendors. svn path=/trunk/; revision=26812
2008-09-30Fix for bug 2917:Jaap Keuter1-14/+9
Modbus Application Protocol Specification V1.1b includes a function 43 (0x2b) Encapsulated Interface Transport. When Wireshark encounters this message it is shown as a TCP message, not a Modbus message. svn path=/trunk/; revision=26314
2008-06-25Constify a bunch of stuff, to squelch -Wwrite-strings warnings. Guy Harris1-2/+2
epan/dissectors/packet-ncp2222.inc is a bit hard to fix, so we're not ready to enable that warning by default yet. Throw in some casts to handle GLib routines that take arbitrary non-const pointers (they can later return the pointers, and some callers might want to modify or free up those pointers in cases where they're known to be writable or allocated). Use ep_tvb_memdup() rather than a combination of ep_alloc() and tvb_memcpy(). Clean up some indentation. svn path=/trunk/; revision=25601