aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-opensafety.c
AgeCommit message (Collapse)AuthorFilesLines
2013-11-16Change editor modelines to reflect actual indentation used in file (4 spaces);Bill Meier1-341/+342
Replace a few tabs with spaces; Fix some spelling in comments; Tweak some whitespace. svn path=/trunk/; revision=53355
2013-10-31From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9345Evan Huus1-28/+98
openSAFETY: Changes for better dissection of additional SADR and SN Fail messages svn path=/trunk/; revision=52998
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-23#if 0 numerous "unused const variables" (mostly value-string-arrays);Bill Meier1-0/+2
Also; fix a few "set but not used" warnings. svn path=/trunk/; revision=52780
2013-10-22openSAFETY: Fixing rare crash as well as dissector errors. Bug 9314 ↵Michael Mann1-66/+82
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9314) From Roland Knall svn path=/trunk/; revision=52752
2013-10-13whitespace fixes; mostly: remove trailing blanksBill Meier1-6/+6
svn path=/trunk/; revision=52591
2013-10-13openSAFETY: Dissection for second crc as well as plausability check. Bug ↵Michael Mann1-24/+108
9261 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9261). From Roland Knall svn path=/trunk/; revision=52582
2013-09-22emem -> wmem conversion:Pascal Quantin1-3/+3
- 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-15From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9145 :Pascal Quantin1-8/+14
openSAFETY: SSDO Abort codes are handled incorrectly svn path=/trunk/; revision=52080
2013-09-12More wmem.Evan Huus1-5/+4
svn path=/trunk/; revision=51968
2013-09-09expert_add_info_format_text -> expert_add_info_formatMichael Mann1-3/+3
svn path=/trunk/; revision=51852
2013-08-19Do not use ephemeral memory when adding a new data sourcePascal Quantin1-1/+3
svn path=/trunk/; revision=51423
2013-08-17Various fixes for dissection bugs from bug 9045 ↵Michael Mann1-12/+65
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9045) - Expert info for CRC 0x5935 got wrongly attached to Slim SSDO packages - SPDO Data Requests that fit in the last bytes of a frame got missed - Slim SSDOs got detected, that actually are not Slim SSDOs, to prevent this in the future, two checks have been added - The reported length of a Slim SSDO must be larger than 0 (correct Slim SSDOs always have at least 1 byte) - Both crc's must differ from another. There is a very unlikely possibility, that they may collide, but in such a case openSAFETY in itself would be flawed by design. svn path=/trunk/; revision=51408
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-05Batch of filterable expert infos.Michael Mann1-1/+1
svn path=/trunk/; revision=50384
2013-07-03Fix some warnings from fix-encoding-args tools.Alexis La Goutte1-2/+2
svn path=/trunk/; revision=50368
2013-07-03Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+0
svn path=/trunk/; revision=50363
2013-07-02From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8878 :Jeff Morriss1-43/+43
The final maintenance patch, after excessive testing of the dissection engine. The last two bugs were: - FindSafetyFrame did not recognize the correct CRC, which in itself did not lead to wrongly detected packages, but was inconsistent with the rest. - CRC == 0 - because 0 is a valid result for the CRC value. svn path=/trunk/; revision=50312
2013-07-01From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8877 :Jeff Morriss1-0/+4
In my last patch (bug #8847), I overlooked a place where I had to check for the old CRC as well, which led to packages that were not detected anymore. This 4 lines fix it. As usual, the patch was tested and works. svn path=/trunk/; revision=50294
2013-06-26openSAFETY: CRC Maintenance, new CRC, new expert interface implemented. Bug ↵Michael Mann1-34/+83
8847 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8847) From Roland Knall svn path=/trunk/; revision=50166
2013-04-16From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8587Evan Huus1-67/+97
Fix openSafety reassembly and dissection when the first package has a payload length of 0. svn path=/trunk/; revision=48877
2013-04-11From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8505Evan Huus1-408/+904
Numerous improvements and fixes for the OpenSafety dissector (too many to usefully list here; see the bug). As noted by Pascal, also fix a copy-paste error in the preferences registration. svn path=/trunk/; revision=48817
2013-03-19From beroset:Anders Broman1-4/+4
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48425
2013-02-26Fix spelling/typos found using a list of commonly misspelled words.Bill Meier1-1/+1
The misspellings were mostly in comments but some were in text strings visible to the user. svn path=/trunk/; revision=47899
2013-01-31Use '#if 0 ... #endif' rather than /** ... **/ to comment outBill Meier1-10/+10
unused hf[] entries (which I should have done in the first place). svn path=/trunk/; revision=47390
2013-01-26Comment out cases of unused hf array entries found by checkhf.Bill Meier1-5/+15
svn path=/trunk/; revision=47302
2012-12-18Don't do proto_tree_add_ether(..., tvb_get_ptr(...)), just use ↵Jeff Morriss1-10/+5
proto_tree_add_item(). svn path=/trunk/; revision=46598
2012-11-19From Roland Knall:Anders Broman1-0/+41
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-10-27Update openSafety dissector with new Modbus dissector table name.Evan Huus1-1/+1
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-24No, it's not necessarily the case that a malformed frame will only occurGuy Harris1-1/+0
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-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45017
2012-09-10Initial commit to support yet another method of passing data between dissectors.Jakub Zawadzki1-5/+5
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-03MT: move global frame_end_routines to packet_info.Jakub Zawadzki1-2/+2
svn path=/trunk/; revision=44748
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-06-09Do not use BASE_NONE for FT_*INT* types.Chris Maynard1-1/+1
svn path=/trunk/; revision=43177
2012-06-05From Roland Knall:Anders Broman1-18/+108
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-03-29Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-3/+0
svn path=/trunk/; revision=41825
2012-03-29From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7003Alexis La Goutte1-49/+68
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-19From Roland Knall:Anders Broman1-27/+56
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-16FT_BOOLEAN hf[] entries with a 0 'bitmask' should have 'display' = BASE_NONE;Bill Meier1-66/+68
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-02-03From Roland Knall via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6786 :Jeff Morriss1-9/+32
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
2011-12-20Checking scmUDID for NULL is pointless since the pointer has already been ↵Chris Maynard1-2/+1
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-15Null out opensafety_item if we're nulling out opensafety_tree.Guy Harris1-1/+2
Clean up indentation. svn path=/trunk/; revision=40217
2011-12-15From Roland Knall:Anders Broman1-56/+140
- 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-13Use tvb_new_child_real_data() instead of tvb_new_real_data() + ↵Bill Meier1-2/+1
tvb_set_child_real_data_tvbuff(). svn path=/trunk/; revision=40173
2011-11-27Various Minor cleanup:Bill Meier1-256/+374
- 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-04From Roland Knall via bug 6538:Stig Bjørlykke1-164/+18
Use CRC routines from wsutil + some Code-Clang Analysis fixes. svn path=/trunk/; revision=39730
2011-11-03From Roland Knall via bug 6538:Stig Bjørlykke1-49/+9
Remove stringToBytes and use hex_str_to_bytes instead. svn path=/trunk/; revision=39725
2011-11-02From Roland Knall:Anders Broman1-6/+4
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-01From Roland Knall:Anders Broman1-109/+182
- 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