ethercat: remove deprecated tvb_length API
authorEvan Huus <eapache@gmail.com>
Mon, 6 Apr 2015 01:28:10 +0000 (21:28 -0400)
committerEvan Huus <eapache@gmail.com>
Mon, 6 Apr 2015 17:17:47 +0000 (17:17 +0000)
Change-Id: I76916948fc06c5a4df5a1188fde164d516b4105d
Reviewed-on: https://code.wireshark.org/review/7938
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
plugins/ethercat/packet-esl.c
plugins/ethercat/packet-ethercat-datagram.c

index e2322025d8b558471bceb15e5c6954eab4930258..73ff29cf79aa55214b46c507f796b38d96e44aa9 100644 (file)
@@ -259,7 +259,7 @@ dissect_esl_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
     static gboolean  in_heur    = FALSE;
     gboolean         result;
     tvbuff_t        *next_tvb;
-    guint            esl_length = tvb_length(tvb);
+    guint            esl_length = tvb_captured_length(tvb);
 
     if ( in_heur )
         return FALSE;
@@ -271,7 +271,7 @@ dissect_esl_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
             ref_time_frame.fd = NULL;
 
         /* Check that there's enough data */
-        if ( tvb_length(tvb) < SIZEOF_ESLHEADER )
+        if ( esl_length < SIZEOF_ESLHEADER )
             return FALSE;
 
         /* check for Esl frame, this has a unique destination MAC from Beckhoff range
index d3ef62d94f0f4b97d1354981ec5a4951eb6dbd2d..cdb0ccb0c0a6ed525feb6d5266cc4363f6266fa8 100644 (file)
@@ -447,7 +447,7 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree
 
    guint ecLength=0;
    guint subCount = 0;
-   const guint datagram_length = tvb_length_remaining(tvb, offset);
+   const guint datagram_length = tvb_captured_length(tvb);
    guint datagram_padding_bytes = 0;
    EcParserHDR ecHdr;
    heur_dtbl_entry_t *hdtbl_entry;
@@ -861,7 +861,7 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree
       which is required by the protocol specification */
    if(datagram_padding_bytes > 0)
    {
-      proto_tree_add_item(tree, hf_ecat_padding, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
+      proto_tree_add_item(tree, hf_ecat_padding, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
    }
 }