Commit Graph

43 Commits

Author SHA1 Message Date
Bill Meier 0960e508e4 Comment out cases of unused hf array entries found by checkhf.
svn path=/trunk/; revision=47302
2013-01-26 18:54:53 +00:00
Jeff Morriss 02a69849b7 Don't do proto_tree_add_ether(..., tvb_get_ptr(...)), just use proto_tree_add_item().
svn path=/trunk/; revision=46598
2012-12-18 22:29:11 +00:00
Anders Broman c9e72f9241 From Roland Knall:
Allow for specific enabling and disabling of heuristic dissectors.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7997

svn path=/trunk/; revision=46085
2012-11-19 20:20:34 +00:00
Evan Huus 0ed00c491d Update openSafety dissector with new Modbus dissector table name.
Fixes
> OOPS: dissector table "mbtcp.modbus.data" doesn't exist
> Protocol being registered is "openSAFETY"
introduced in revision 45793.

svn path=/trunk/; revision=45807
2012-10-27 02:53:29 +00:00
Guy Harris 3ceef88b49 No, it's not necessarily the case that a malformed frame will only occur
during fuzz testing or randpkt testing; somebody might be putting bad
packets on the wire to try to, for example, crash or break into your
protocol implementation.

svn path=/trunk/; revision=45749
2012-10-24 04:03:58 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Jakub Zawadzki 5a8783f5b1 Initial commit to support yet another method of passing data between dissectors.
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL

svn path=/trunk/; revision=44860
2012-09-10 21:40:21 +00:00
Jakub Zawadzki 5ad3e5331e MT: move global frame_end_routines to packet_info.
svn path=/trunk/; revision=44748
2012-09-03 12:00:40 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Chris Maynard d9a5e3a1d2 Do not use BASE_NONE for FT_*INT* types.
svn path=/trunk/; revision=43177
2012-06-09 17:47:58 +00:00
Anders Broman 28098ed4ab From Roland Knall:
openSAFETY - Names for certain SOD objects, automatic SCM UDID detecion.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7335

svn path=/trunk/; revision=43109
2012-06-05 13:12:28 +00:00
Alexis La Goutte 1acb420248 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=41825
2012-03-29 17:34:21 +00:00
Alexis La Goutte 508cb1aa2f From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7003
openSAFETY - Cleanup SSDO dissection, add additional information, remove logic bug

- rename isRequest to isResponse, which is the right name for it
- clean-up elseif to a better readable stand-alone if-clause
- add sender for response package without valid scm

svn path=/trunk/; revision=41824
2012-03-29 17:26:56 +00:00
Anders Broman 81bc7b28aa From Roland Knall:
Guards the calledOnce boolean, against malformed traps, using register_frame_end_routine.
Fixes openSAFETY - Malformed packets disable the dissector for the WS session

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6950

svn path=/trunk/; revision=41674
2012-03-19 14:33:37 +00:00
Bill Meier 198c9ba55f FT_BOOLEAN hf[] entries with a 0 'bitmask' should have 'display' = BASE_NONE;
In some cases:
 Use val_to_str_const() instead of val_to_str();
 Reformat long lines;
 Do some general whitespace changes.


svn path=/trunk/; revision=41587
2012-03-16 02:00:29 +00:00
Jeff Morriss e8eba3cd1e From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6786 :
Rare messages can be malformed as such, that the first part is valid, the
second part fails. For SNMT messages, this patch fixes the problem as such that
it displays a correct column header and adds an expert info explaining the
issue.

svn path=/trunk/; revision=40829
2012-02-03 22:12:04 +00:00
Chris Maynard 44a81d13b6 Checking scmUDID for NULL is pointless since the pointer has already been dereferenced. If g_byte_array_new() can return NULL, then the code should be modified to protect against deferencing the NULL pointer much sooner than this.
svn path=/trunk/; revision=40251
2011-12-20 17:59:51 +00:00
Guy Harris 3422b119f6 Null out opensafety_item if we're nulling out opensafety_tree.
Clean up indentation.

svn path=/trunk/; revision=40217
2011-12-15 20:59:44 +00:00
Anders Broman 939ae71194 From Roland Knall:
- New Config option to configure the sequence of frames using UDP
- an Info will be added, if the SCM UDID is not configured or if it is wrongly
configured, so that the user can act on it.
- SCM UDID will only be printed if configured correctly, if not a warning will
be added to inform, that the first byte for the UDID will be assumed to be 00
- UDP dissection can enforce the number of sub-package the dissection should
assume
- SSDO: isRequest is determined by it's field not by the message id
- SSDO: Unused code for SNMT Reset Guarding SCM has been removed
- SNMT: error_group and error_code for SN_FAIL have not been dissected
correctly
- Sercos III: bug != instead of ==, is fixed
- dissect_opensafety_udp renamed to dissect_opensafety_udpdata, because of
future dissector called opensafety_udp which will handle transport of
openSAFETY data over UDP
- dissect_opensafety_udpdata enhanced to determine the index of the given frame
in the package. Needed for correct assembly of COL_INFO
- Added heuristic dissector hook for opensafety_udp dissector. The dissector
will be submitted to this list at a future point

- Enhanced description of the dissector to reflect it's capabilities
- Reworked the description for the config options to be more understandable

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6672

svn path=/trunk/; revision=40214
2011-12-15 20:34:45 +00:00
Bill Meier 4a976f1be7 Use tvb_new_child_real_data() instead of tvb_new_real_data() + tvb_set_child_real_data_tvbuff().
svn path=/trunk/; revision=40173
2011-12-13 04:01:33 +00:00
Bill Meier c4ace59928 Various Minor cleanup:
- Remove unneeded #includes;
- Use val_to_str_const() in several places;
- Reformat long lines;
- Fix whitepace and indentation.

svn path=/trunk/; revision=40016
2011-11-27 15:34:07 +00:00
Stig Bjørlykke d4e7b76316 From Roland Knall via bug 6538:
Use CRC routines from wsutil + some Code-Clang Analysis fixes.

svn path=/trunk/; revision=39730
2011-11-04 08:15:29 +00:00
Stig Bjørlykke 91eab9d737 From Roland Knall via bug 6538:
Remove stringToBytes and use hex_str_to_bytes instead.

svn path=/trunk/; revision=39725
2011-11-03 20:38:04 +00:00
Anders Broman 083dbff6f9 From Roland Knall:
Remove the warnings for the Clang-Code-Analysis.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6538

svn path=/trunk/; revision=39717
2011-11-02 19:28:38 +00:00
Anders Broman 228b478691 From Roland Knall:
- Renaming opensafety.msg.type to opensafety.msg.direction
- Introducing real opensafety.msg.type as opensafety.msg.category and generated
field
- Adding openSAFETY Sender and Receiver field, for all types of messages
- Adding openSAFETY Domain number and Node number as generated fields, which
allows filtering for them
- Rework PACKET_RECEIVED_BY and PACKET_SEND_FROM_TO_ALL to PACKET_RECEIVER and
PACKET_SENDER
- Replaced PACKET_SEND_FROM_TO with calls to PACKET_RECEIVER and PACKET_SENDER
- Added functions, so that the new sender and receiver fields as well as
network information are added as sub-trees
- Removed DISSECTOR_ASSERT in opensafety_get_scm_udid as it is not needed here
anymore
- Added the connection valid bit to the dissection tree ( has been there as
message type, but was never validated )
- Added calculations for Domain Network Addr, depending if a valid UDID for the
SCM is present in SSDO and SPDO
- Corrected error, where sub-tree for spdo dissection used global ssdo_tree
instead of spdo_tree
- Added "Message Type unknown" which leads to PI_MALFORMED marked entry in
dissect_opensafety_message
- Added check for ( length - frameOffset ) is below or equal zero, to avoid
using dissector asserts
- Added check for freak frame start detection, where both frame starts would be
equal (could happen during fuzztest)
- Removed DISSECTOR_ASSERT for both frame starts being different
- Added check, that if the frame address is above 1024, the package get's
marked as PI_MALFORMED (fuzztest)
- Fixed CID 1215, CID 1224 and CID 1246/1247
- Corrected naming issue with openSAFETY/SercosIII dissection using UDP
transport

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6528

svn path=/trunk/; revision=39701
2011-11-01 06:12:33 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Chris Maynard 345d384f29 Fix Coverity CID 1204: CONSTANT EXPRESSION RESULT according to feedback from Roland Knall. See http://www.wireshark.org/lists/wireshark-dev/201109/msg00160.html. Also, convert the relatively few tabs to 4-spaces to match the rest of this dissector's white space choice and add modelines.
svn path=/trunk/; revision=39204
2011-09-30 21:36:13 +00:00
Anders Broman d406b805a1 From Roland Knall:
Address Coverty issues CID 1204, CID 1215, CID 1224, CID 1246, CID 1247

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6400

svn path=/trunk/; revision=39182
2011-09-29 06:13:13 +00:00
Chris Maynard 4d30da3a59 Removed the call to g_warning() in proto_reg_handoff_opensafety(), as I didn't care to see the "openSAFETY - Profinet IO heuristic dissector cannot be registered, openSAFETY/PNIO native dissection." message when I ran, "tshark -v".
svn path=/trunk/; revision=38676
2011-08-23 01:08:32 +00:00
Bill Meier 2bf572bc41 Remove unneeded #includes: proto.h,tvbuff.h,value_string.h,stdlib.h,...
svn path=/trunk/; revision=38413
2011-08-08 17:59:32 +00:00
Guy Harris d4c6d19cd3 If you have a loop that iterates over packet contents, you absolutely
must not just do a "continue" if the offset into the packet has not been
advanced, as you will get an infinite loop if you do.

svn path=/trunk/; revision=38383
2011-08-07 08:26:29 +00:00
Chris Maynard 4e4f13db59 Fix 45 occurrences of unused values reported under Coverity CID's 1235-1241.
svn path=/trunk/; revision=38315
2011-08-02 20:39:53 +00:00
Anders Broman 538ab09091 From Roland Knall:
openSAFETY: Cleaning up, removing multiple implementations and cleaning up code
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6180

svn path=/trunk/; revision=38307
2011-08-02 05:30:59 +00:00
Chris Maynard b8a7e02e4b Avoid a crash reported in bug 6138 by never allowing frame1Size < dataLength.
Reference: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6138

svn path=/trunk/; revision=38213
2011-07-26 16:19:48 +00:00
Bill Meier b17543e2c0 Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings.
svn path=/trunk/; revision=38049
2011-07-15 19:07:25 +00:00
Anders Broman 509c6a7fc0 From Roland Knall:
This patch will add preliminary Profinet IO transport protocol dissection to
the openSAFETY protocol.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6063

svn path=/trunk/; revision=37887
2011-07-04 14:00:51 +00:00
Anders Broman 8b303cc61a From Roland Knall:
The way heuristic dissection was handled by the openSAFETY plugin, could lead
to out-of-memory problems with large files (>50.000 packets). The new version
does not use ep_alloc anymore, but a static boolean instead.

Also, the code registering for the SercosIII dissector got simplified, as the
SercosIII dissector is no longer a plugin.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6061

svn path=/trunk/; revision=37874
2011-07-03 16:03:46 +00:00
Anders Broman 84cef97505 From Roland Knall:
Two changes for openSAFETY over Modbus/TCP:

1. Changing the default preference for Big Endian encoding from TRUE to FALSE
2. Changing the position in the tree for the dissection to the top-level,
therefore, the openSAFETY entries no longer will show up as children of the
Modbus entry. This is the same behaviour as the other variants for openSAFETY
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6038

svn path=/trunk/; revision=37739
2011-06-21 05:21:15 +00:00
Anders Broman 1265b4542f From Roland Knall:
openSAFETY: Making the UDP ports configurable; Modbus/TCP support 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5999

svn path=/trunk/; revision=37686
2011-06-17 01:56:35 +00:00
Anders Broman 30a3988111 Move the warning "...SercosIII heuristic dissector cannot be registered.." to the handoff routine as sercosIII most probably will
not have registered it's name when opensafty's register routine is executed e.g the warning will always be printed.

svn path=/trunk/; revision=37615
2011-06-08 12:02:38 +00:00
Gerald Combs 051ff221fe From Roland Knall via bug 5977:
Handling of SercosIII if the plugin can not be loaded.

Changed the behaviour - if the SercosIII plugin is not available, the
openSAFETY dissector registers itself for ETHERTYPE_SERCOS. SercosIII
packages can not be dissected anyway in such a case and currently no
other dissector will handle those packages.

The following steps will be taken to display the situation to the user:

The message "SercosIII dissector not available, openSAFETY/SercosIII
native dissection." will be added to the tree. Additionally a similar
warning will be presented on the console during startup of wireshark.

All openSAFETY packages will be dissected, displaying the normal
openSAFETY information.

This will be more transparent for the customer.

svn path=/trunk/; revision=37533
2011-06-03 16:56:09 +00:00
Bill Meier ce0d6a52b5 Fix Bug #5984: Infinite loop caused by fcn call arg conversion: guint->guint8
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5984

svn path=/trunk/; revision=37521
2011-06-02 14:22:19 +00:00
Guy Harris c681f0434e From Roland Knall: openSAFETY dissector.
svn path=/trunk/; revision=37487
2011-05-31 19:31:45 +00:00