CIP: Pull out segment parsing to separate functions

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>
This commit is contained in:
Dylan Ulis 2018-05-26 10:17:28 -04:00 committed by Anders Broman
parent 20db0cafec
commit d90aa21395
1 changed files with 580 additions and 551 deletions

File diff suppressed because it is too large Load Diff