PROFINET: Adding text to Normal (non-DFP) RTC3 frames
authorbasakkal <basakkalfa@gmail.com>
Thu, 3 Oct 2019 15:08:58 +0000 (08:08 -0700)
committerAnders Broman <a.broman58@gmail.com>
Fri, 4 Oct 2019 06:23:23 +0000 (06:23 +0000)
According to specification, Normal (non-DFP) RTC3 frames
are not decoded as subframes. However, undecoded data was
not shown at the tree. The undecoded data text is added

Change-Id: Ib6ffd750c81d05318d9b81debd73a1f8022bbbb7
Reviewed-on: https://code.wireshark.org/review/34698
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
plugins/epan/profinet/packet-pn-rt.c

index dd4be8e92535c6f9699a9a37f07246c6830c4232..0e41e668a8221c746b158c6adb5959be032e9d01 100644 (file)
@@ -267,7 +267,7 @@ dissect_DataStatus(tvbuff_t *tvb, int offset, proto_tree *tree, packet_info *pin
 
 
 static gboolean
-IsDFP_Frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 u16FrameID)
+IsDFP_Frame(tvbuff_t *tvb, packet_info *pinfo, guint16 u16FrameID)
 {
     guint16       u16SFCRC16;
     guint8        u8SFPosition;
@@ -300,7 +300,6 @@ IsDFP_Frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16 u16Fram
     {
         if (u16SFCRC16 != crc)
         {
-            proto_item_append_text(tree, ", no packed frame: SFCRC16 is 0x%x should be 0x%x", u16SFCRC16, crc);
             return(FALSE);
         }
     }
@@ -368,7 +367,7 @@ dissect_CSF_SDU_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
     /* possible FrameID ranges for DFP */
     if ((u16FrameID < 0x100) || (u16FrameID > 0x0FFF))
         return (FALSE);
-    if (IsDFP_Frame(tvb, pinfo, tree, u16FrameID)) {
+    if (IsDFP_Frame(tvb, pinfo, u16FrameID)) {
         /* can't check this CRC, as the checked data bytes are not available */
         u16SFCRC16 = tvb_get_letohs(tvb, offset);
         if (u16SFCRC16 != 0) {
@@ -437,6 +436,11 @@ dissect_CSF_SDU_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
         return TRUE;
     }
 
+    else {
+        offset = dissect_pn_user_data(tvb, offset, pinfo, tree, tvb_captured_length_remaining(tvb, offset),
+                 "PROFINET IO Cyclic Service Data Unit");
+    }
+
     return FALSE;
 
 }