aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cip.c
AgeCommit message (Collapse)AuthorFilesLines
2021-02-15Set a few more dissector vars/funs to static.Martin Mathieson1-1/+1
These are the last of the easy ones to fix/set.
2021-02-14Make some more variables and functions static.Martin Mathieson1-8/+8
2020-09-27Fix some wrong filter names.Martin Mathieson1-1/+1
These were detected by running check_typed_item_calls.py with --consecutive, which flags items that have different labels but the same filter string. Usually this is because of copy/paste. Quite a few similar bugs still exist, will address in a future commit.
2020-08-27CIP: Combine connection structsDylan Ulis1-3/+2
Notes: 1. There are no functionality changes with this delivery 2. This change is to reduce manual copying between structs. This will make it easier to add upcoming feature changes, and fix some connection handling issues (future merge requests). 3. Combine enip_conn_val_t and cip_conn_info_t. Previously, there were 2 different structs to track information about an overall CIP Connection.
2020-08-27CIP: Combine handling for cip_connID_info_t connectionsDylan Ulis1-35/+30
Notes: 1. There are no functionality changes with this delivery 2. cip_connID_info_t describes a one-way connection. Each CIP Connection includes 2 of these. Previously, each operation was duplicated for each direction. 3. This change is to reduce copypaste, simplify logic, and make it easier to add upcoming feature changes, and fix some connection handling issues (future merge requests) Changes: 1. Extract Method: get_conversation_info_one_direction 2. dissect_net_param16/dissect_net_param32: Parse and set data into cip_connID_info_t
2020-07-14B&R - company namingRoland Knall1-1/+1
- refactoring of B&R specific company naming Change-Id: Ic8533617f61f5bee009e1d00ebc323e00f28b3e8 Reviewed-on: https://code.wireshark.org/review/37851 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2020-06-19Fix the type of arrays of pointers to hf_ values for bitfield routines.Guy Harris1-7/+7
The static arrays are supposed to be arrays of const pointers to int, not arrays of non-const pointers to const int. Fixing that means some bugs (scribbling on what's *supposed* to be a const array) will be caught (see packet-ieee80211-radiotap.c for examples, the first of which inspired this change and the second of which was discovered while testing compiles with this change), and removes the need for some annoying casts. Also make some of those arrays static while we're at it. Update documentation and dissector-generator tools. Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc Reviewed-on: https://code.wireshark.org/review/37517 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-13CIP Motion: Connection Configuration DataDylan Ulis1-34/+98
1. Dissect the Motion Configuration Block from the Forward Open 2. Add Motion Attributes related to #1 3. Save the first/last segment for certain segment types in an EPATH. Behavior changes based on the values in first segments for a given type, vs later segments. Change-Id: Id0552a585d158041c13adfa50f4bb164cada79b7 Reviewed-on: https://code.wireshark.org/review/37168 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-07CIP: Various UpdatesDylan Ulis1-52/+153
1. Electronic Key Segment: Add support for Serial Number Key Format 2. Electronic Key Segment: Display more values in generated (response) output 3. Display Route/Connection Path in response data 4. Add more device types, class names 5. Minor display improvements to text strings, units for clarity Change-Id: Ie7738cb395579674db448535474444da49b5b297 Reviewed-on: https://code.wireshark.org/review/37156 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-03-17CIP Safety: Change MacID to NodeIDDylan Ulis1-8/+8
This matches the wording in the Spec. Change-Id: I566da78e88ff5aaa832c657dd74b5c590ee6b4aa Reviewed-on: https://code.wireshark.org/review/36479 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-08-24Modbus: Unit and Transaction Id for request/response identificationThomas Wiens1-4/+10
Use Unit and Transaction Identifier to identify the correct request to a response. The Transaction Identifier is only available in Modbus TCP. Bug: 15698 Change-Id: Ic3a279ce200bee9e9274aaec66bd9dc2f1c096b9 Reviewed-on: https://code.wireshark.org/review/34274 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-17CIP: Don't parse error responses as SuccessDylan Ulis1-2/+2
Remove most cases where we were processing CI_GRC_SERVICE_ERROR as a success condition. Leave CI_GRC_SERVICE_ERROR in some cases where this may make sense, eg: Modbus embedded messages may still want to be parsed as the embedded format. Bug: 15669 Change-Id: I44cae1ea8d3bacd6291a3118750f8a9e825de044 Reviewed-on: https://code.wireshark.org/review/32874 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-04-04epan: Convert our PROTO_ITEM_ macros to inline functions.Gerald Combs1-42/+42
Convert our various PROTO_ITEM_ macros to inline functions and document them. Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c Reviewed-on: https://code.wireshark.org/review/32706 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-02-11CIP: Fix false positive expert infoDylan Ulis1-1/+1
Some buffer size checking was off by 1. Change-Id: Ib99da61f476b6f20abe40311fd2112a8693a7878 Reviewed-on: https://code.wireshark.org/review/31946 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-18CIP: Improve API/RPI precisionDylan Ulis1-33/+27
1. Show 3 digits of precision after the decimal place for API/RPI when displaying in ms. 2. Remove displaying the value as hex microseconds. Change-Id: I483739c13ff0e02bd773b5207b41a5eec6c23289 Reviewed-on: https://code.wireshark.org/review/31583 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-17CIP: Add more objectsDylan Ulis1-1/+10
Add newer CIP objects Change-Id: Ie1fcc219ee2d8abece8aaa9c4bbaade42f029ef9 Reviewed-on: https://code.wireshark.org/review/31568 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-15CIP: Correct SSN to SNNDylan Ulis1-31/+31
SNN = Safety Network Number No functional/parsing changes. Changes: 1. Fix some display fields and filter names that previously used the incorrect ssn naming. 2. Changed all variable names in a similar way. Change-Id: I7bdc52a5aef31a9c6007545d5a79c99bab6cd184 Reviewed-on: https://code.wireshark.org/review/31549 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-07CIP: Correct DATE_AND_TIME parsingDylan Ulis1-2/+2
DATE_AND_TIME struct is actually time then date. We were previously parsing it as date then time. Change-Id: I7367b5502318de32b7c9e7fd170ae58de4c3347f Reviewed-on: https://code.wireshark.org/review/31431 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-27Try to squeeze some bytes out of the frame_data structure.Guy Harris1-3/+3
Make the time stamp precision a 4-bit bitfield, so, when combined with the other bitfields, we have 32 bits. That means we put the flags at the same structure level as the time stamp precision, so they can be combined; that gets rid of an extra "flags." for references to the flags. Put the two pointers next to each other, and after a multiple of 8 bytes worth of other fields, so that there's no padding before or between them. It's still not down to 64 bytes, which is the next lower power of 2, so there's more work to do. Change-Id: I6f3e9d9f6f48137bbee8f100c152d2c42adb8fbe Reviewed-on: https://code.wireshark.org/review/31213 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-15CIP: Minor code cleanupDylan Ulis1-125/+130
dissect_cip_cm_data() was getting hard to read so: 1. Pull out some some logic into separate functions dissect_cip_cm_unconnected_send_req dissect_cip_cm_fwd_close_req dissect_cip_cm_fwd_close_rsp_success 2. Reduce the scope of some variables. No functional changes Change-Id: I40c3dd5d2505b29991589ede4752c383348006ec Reviewed-on: https://code.wireshark.org/review/31051 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-11CIP: Show more unparsed dataDylan Ulis1-34/+44
Extra data could be an indicator of a problem, or it could be that we haven't added support in Wireshark for it yet. Either way, it's helpful to show it, instead of hiding it. Changes: 1. Show unparsed data in the CIP CM dissector 2. Clean up some offsets Change-Id: Ieebe208aab1f293f97a8774a6a4de5d5dbd3df67 Reviewed-on: https://code.wireshark.org/review/31003 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-10CIP: Add Connection IndexDylan Ulis1-0/+23
Add cip.connection. This works just like tcp.stream, but for CIP connections. This is added to CIP connected messages and the Forward Open/Close messages. Change-Id: Ib358c00dc0a4fd61065cb22b0e9b574ac43a44a4 Reviewed-on: https://code.wireshark.org/review/30984 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-09CIP: Improve connected data informationDylan Ulis1-17/+13
1. For each connected data message, display generated connection information including: a. Connection Path from the initial connection b. API values c. Forward Open packet number. (This already existed, but moving it to a consistent place in the tree) 2. Display O->T or T->O in the Info column depending on the direction of data. 3. Remove cip.conn_path_class filter. This was originally added to show which type of data is in a given packet. But, it's not really needed anymore because we have the generated connection path in each connected data packet now. 4. Ensure dummy structs used for Decode As menus are zeroed out. 5. memset -> zero initialization pcaps from the following bug reports are good examples: Bug: 14939 Bug: 6617 Bug: 14916 Bug: 14958 Change-Id: I63885a5ca41f95e04f855a1e1dcd9ab3684f7eec Reviewed-on: https://code.wireshark.org/review/30808 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-07-13CIP Motion: Update attribute service handlingDylan Ulis1-18/+10
1. Get/Set Axis Attribute List: Display the attribute name, and dissect where appropriate. 2. Minor: Cleanup exported functions/variables. Bug: 14958 Change-Id: I2ff6883e66068472ac5ded0172f51575f5e20a21 Reviewed-on: https://code.wireshark.org/review/28660 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-06-27CIP: Improve Class 2/3 connection handlingDylan Ulis1-8/+7
1. Add new dissector table that allows for registration of CIP Class 2/3 Data against CIP Class that was used in the Forward Open. This is similar to the Class 0/1 I/O dissector table. The new logic is this: a. If there is connection info and a table entry: Call the registered dissector handle (cip_connection_message_router.pcap). b. If there is connection info and no table entry, use the CIP implicit dissector (cip_connection_implicit.pcap) c. If there is no connection info: Assume Message Router (Class 0x2) format (cip_no_connection_message_router.pcap) 2. Remove old dissector table for "enip.sud.iface". The specification states that the Interface Handle "shall be zero" for SendUnitData, so there isn't a need to have custom handling for different Interface Handle values. SendRRData does not have the same restriction, so that dissector table (enip.srrd.iface) will stay. 3. Pull out Class 2/3 data processing into separate function: dissect_cip_class23_data() 4. Remove extra unnecessary tree layer in implicit data dissector. Bug: 14916 Change-Id: Id53a2031a6064551b3915d8954527a7b3261d222 Reviewed-on: https://code.wireshark.org/review/28496 Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-18CIP: Improve I/O handlingDylan Ulis1-3/+3
1. Add new dissector table that allows for registration of CIP Class 0/1 I/O against CIP Class that was used in the Forward Open. CIP Safety is still a special case that gets checked before this table. The default handling is generic CIP Class 0/1 I/O. 2. Changed most I/O items labelled "ENIP" to "CIP I/O". ENIP is a separate protocol/layer, and all the I/O traffic is actually CIP. It was very confusing explaining to people they had to look at the wrong protocol layer in Wireshark before. 3. Add the generic Class 0/1 I/O as a separate tree layer. CIP Motion and CIP Safety I/O were already doing this. 4. Update CIP conversation filtering naming to be more accurate. 5. Clean up some offset handling Change-Id: I1c226fe1bd8974ed0e90640c875bef21f15f3095 Reviewed-on: https://code.wireshark.org/review/28290 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-03CIP: Remove extra tree level from path segmentsDylan Ulis1-96/+60
There was an extra level of indentation in the tree structure that didn't add any value. This tree node just displayed the same text that it's parent tree did. Just remove this to make things easier to navigate. See feature_cip_all_segments.pcap from Bug: 12049 Change-Id: Ia51f0f66b1ea0aefaa4d016335c0d5e8515a2c30 Reviewed-on: https://code.wireshark.org/review/27958 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-01CIP: Minor updatesDylan Ulis1-11/+22
1. Time Sync Port Physical Address Info: Finish parsing this 2. Connection Manager: Add more service names 3. Add more Device Type enumerations 4. Unconnected Send Unsuccessful Response: Add the reserved byte 5. Vendor ID -> Originator Vendor ID 6. Add some BASE_UNIT_STRING Change-Id: I112c44330cc4051d2eea8d149e3cbbf8eaef1247 Reviewed-on: https://code.wireshark.org/review/27937 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-01CIP: Use a struct for connection triadDylan Ulis1-70/+76
1. Connection Serial Number, Vendor ID, and Device Serial Number are always used as a group. Group these as a struct to make them easier to manage. 2. Pull out common code into dissect_connection_triad() No functional changes. Change-Id: Ide126f8d0ea6ab8e2de5abf20e12643d5a35924d Reviewed-on: https://code.wireshark.org/review/27926 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-28CIP: Pull out segment parsing to separate functionsDylan Ulis1-551/+580
dissect_cip_segment_single was huge and too hard to read and update. This change pulls out segment parsing into individual functions to make it easier to read, and will help with upcoming changes. There are no functional changes. I verified that the packet parsing is identical before and after using feature_cip_all_segments.pcap from Bug: 12049 Main changes: 1. Pulled out the following code into separate functions: dissect_segment_port dissect_segment_safety dissect_segment_data_simple dissect_segment_ansi_extended_symbol dissect_segment_logical_service_id dissect_segment_logical_special dissect_segment_network 2. In dissect_cip_segment_single, no need to explictly check for zero segment_len in many cases because the function will already return zero in those cases. Change-Id: Id437bb34dc665ac37f428b8fdab0c89c454ad25e Reviewed-on: https://code.wireshark.org/review/27845 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-20CIP: Code cleanupDylan Ulis1-207/+196
1. Convert more things to proto_tree_add_bitmask 2. Remove unnecessary pathpos param everywhere 3. Replace some tvb_get_xxx with proto_tree_add_item_ret_uint 4. Remove unused variables, params 5. Remove if(tree) There are no functional changes. In the area where there is a lot of diff (eg: pathpos), I verified using the pcap from Bug: 12049, and compared the PDML output before and after, just as a sanity check. Change-Id: I9564172ccece558cf1877b667f713b584a00d73f Reviewed-on: https://code.wireshark.org/review/27642 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-11CIP: Data Type updatesDylan Ulis1-53/+49
1. Convert lots of things to use the new BASE_UNIT_STRING feature 2. ANSI Symbol: Print size correctly in generated response 3. Attribute Status is a 1 byte value in Get/Set_Attribute_Lists 4. Forward Open: Indicate this is a Safety connection in info column. This is useful because Safety connections aren't obvious from the CIP Class like other connections (eg: Motion) Change-Id: I8cb00fd0141d75a3e9425d8e618b1f54d12807be Reviewed-on: https://code.wireshark.org/review/27447 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-04CIP Motion: Attribute SupportDylan Ulis1-1/+3
1. Add attribute table similar to the other CIP related dissectors. Currently, this just adds 2 attributes. More will come in separate reviews. (Still clarifying some information in the Spec) 2. Minor wording updates to match spec Change-Id: I667b8e465d576020471c8e7fc10b43e25ea573dd Reviewed-on: https://code.wireshark.org/review/27180 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Jim Young <jim.young.ws@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-19CIP: fix no previous prototype for ↵Alexis La Goutte1-1/+1
‘add_cip_pccc_function_to_info_column’ [-Wmissing-prototypes] Change-Id: Id5737f6bc054ce4c51b28097b0db341f7debfe2e Reviewed-on: https://code.wireshark.org/review/27028 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-05The CPU mode values might be function-dependent.Guy Harris1-5/+20
Have separate ones for function 3A and function 80. Change-Id: I44560099de269ea809092d5bc7ad88308c9082be Reviewed-on: https://code.wireshark.org/review/26767 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-05Interpretation of PCCC function codes depends on the command code value.Guy Harris1-17/+48
We can't have a single table to map function codes to names; we need separate tables for different command codes. We also can't have a single field for the function code; we need separate fields for different command codes. While we're at it, use proto_tree_add_item_ret_uint() to add the command code and function code, rather than separately fetching those values. Change-Id: Ic2646da6c6a1cae13c513874c5c003f32fce434e Reviewed-on: https://code.wireshark.org/review/26764 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-05Sort the PCCC_ES values, as required in a value_string_ext.Guy Harris1-3/+3
Change-Id: If3f093ba19cce1a69c1540518e622e4098ba82b6 Reviewed-on: https://code.wireshark.org/review/26763 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-05ENIP-CIP-PCCC: add support for the CIP PCCC ObjectJared Rittle1-6/+471
Support has been added to the EtherNet/IP (ENIP) CIP dissector (packet-cip.c) to allow for the dissection of Programmable Controller Communication Commands (PCCC). These commands are often seen in the traffic of Programmable Logic Controllers (PLCs) communicating over the EtherNet/IP or DF1 protocols. Dissection has been implemented directly in the packet-cip dissector, following the structure put in place by other existing CIP classes such as the Connection Manager. Change-Id: Ia1e614fb7fd9fd36e79c0dac06cd5f1a9c1cea78 Reviewed-on: https://code.wireshark.org/review/26713 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08CIP: Highlight correct bytes in Req/Rsp processingDylan Ulis1-5/+9
Previously, dissect_cip_generic_service_req and dissect_cip_generic_service_rsp set lengths at different levels of the packet. In some cases, this would cause a malformed packet when the data length was zero. This fixes the malformed error by explicitly setting the length, instead of using -1. The length of the service data set is not the data paylod for both cases. Previously, for requests, it attempted to highlight the whole CIP layer, but this was already covered by the full CIP protocol layer length. Change-Id: I4b4a99d30b9e04872fcf7ffb127c496e6062856c Reviewed-on: https://code.wireshark.org/review/25672 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-03CIP Motion: Support Format Revision 3Dylan Ulis1-3/+44
See Volume 9, version 1.2, sections "6-2.7.1.1" and "7-1.1" 1. Pass Connection Point from FwdOpen to Motion dissector, since that is now needed to parse I/O payload. 2. Move Run/Idle Header function to CIP dissector, since it's a CIP feature, not ENIP. 3. Add a protocol so that Format Revision 3 can be dissected without the Forward Open in the capture. 4. Minor: Highlight more bytes in some EPATH parsing. 5. Minor: Renaming some things to match spec wording. Change-Id: I93626a6492be2675206d38c04fa1c7ce534c04ca Reviewed-on: https://code.wireshark.org/review/25570 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-29cip: initialize variable (CID: 1403067).Dario Lombardo1-0/+2
Change-Id: I65c1b59f8dd6adb471872b74ec9963066053ec66 Reviewed-on: https://code.wireshark.org/review/25071 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-22Create temporary variables for some proto_tree_add_<datatype> calculations.Michael Mann1-5/+10
checkAPIs.pl doesn't like tvb_get_* parameters because it thinks proto_tree_add_item should be used. This is just to pacify the check. Change-Id: I2df1233fe8c7976c257197079c06d24e472303b5 Reviewed-on: https://code.wireshark.org/review/21735 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-18CIP: Fix Assigned value is garbage or undefined found by Clang AnalyzerAlexis La Goutte1-1/+1
Change-Id: Ie3d97ef22c6c8f69855f747f78b86d94f1091fa9 Reviewed-on: https://code.wireshark.org/review/20606 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-16Add support for verifying CIP Safety CRC values.Michael Mann1-4/+20
Change-Id: I44f7ff6980f27b1a0d4199a91f9b217aec7e4652 Reviewed-on: https://code.wireshark.org/review/20557 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>
2017-03-14CIP: Log more errors when expected data is missingD. Ulis1-19/+34
1. CIP: Instead of exiting early in dissect_cip_generic_service_req/rsp when there is no data, keep processing so that a malformed packet warning will be displayed when there should be data. 2. CIP Safety: Remove copy-paste. Use load_cip_request_data 3. CIP Safety: Use more constants. Change-Id: Ic364201f1e587b43cf2bda407fb77b50032974ae Reviewed-on: https://code.wireshark.org/review/20549 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-12-21CIP: More attribute updatesD. Ulis1-9/+56
1. CIP Safety: SERCOS Safety Network Number attribute should be 6 bytes. Don't just use all remaining bytes 2. Remove cip_byte_array type. The last remaining usage was #1 above and it really shouldn't be used in the future. Any attribute that would eat up all remaining bytes would have issues with Get Attribute List responses and Set Attribute List requests. 3. Optional Attribute List: Display the attribute name if known. 4. Port: Display Port Number name 5. Port: Associated Communication Objects attribute Change-Id: I94d99bb1f07aa4b8c44949b2ffb5d75e72483459 Reviewed-on: https://code.wireshark.org/review/19374 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-12-16CIP: Always handle extra dataD. Ulis1-197/+90
1. Generically handle/display all unparsed data. Any unparsed data can be found with cip.data 2. This now shows at least some unparsed data that was not previously displayed. Previously, extra data sent with Get Attribute List requests was not displayed. It was difficult to tell why devices were returning errors, without knowing there was extra data. 3. Make most functions return the number of bytes processed to support the above points. Change-Id: I290c09d76e74c18facaef99c8903e7937fbdd710 Reviewed-on: https://code.wireshark.org/review/19263 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-12-13Adjust proto_tree_add_uint_format_value calls to use unit stringMichael Mann1-2/+2
Several calls to proto_tree_add_uint_format_value could be better served using BASE_UNIT_STRING with a "unit string" in hf_ field. There also a few cases where proto_tree_add_uint_format_value could just be proto_tree_add_uint. Added a few more "common" unit string values to unit_strings.[ch] Change-Id: Iaedff82c515269c9c31ab9100dff19f5563c932d Reviewed-on: https://code.wireshark.org/review/19242 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-06CIP: Minor enhancementsD. Ulis1-42/+63
1. ENIP: Display the CIP Forward Open Request packet number for connected data 2. CIP: Extended Network: Display expert info when the expected bytes does not match actual bytes 3. CIP: Look up more data fields as CIP service or Device Type 4. CIP: Display data as Dec/Hex, depending on how the spec shows things 5. Minor: Pull out common code into load_cip_request_data() 6. Minor: Text corrections Change-Id: I184ac3899786f650e4d4643a5dfe68bba785d6e0 Reviewed-on: https://code.wireshark.org/review/19092 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>