diff options
author | Evan Huus <eapache@gmail.com> | 2014-09-08 21:59:38 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-09-10 07:54:00 +0000 |
commit | f9d4e0a815cf9c8f1fe5a5a106fcce3755daf8f2 (patch) | |
tree | f3abbec56de906935bd40771c4be791e6fb695ea /epan/dissectors/packet-ses.c | |
parent | 1bf82c3b64b798eb3df99d24819fc8a961d7dbe0 (diff) |
Replace deprecated tvb_length calls
And a few other misc. cleanups while in the neighbourhood.
Change-Id: Ic0d6836dec9c36d31ea244a6adc74d4713565090
Reviewed-on: https://code.wireshark.org/review/4047
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-ses.c')
-rw-r--r-- | epan/dissectors/packet-ses.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ses.c b/epan/dissectors/packet-ses.c index 3aa9005262..e39fb1abb1 100644 --- a/epan/dissectors/packet-ses.c +++ b/epan/dissectors/packet-ses.c @@ -1157,7 +1157,7 @@ dissect_spdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, * No more SPDUs to dissect. Set the offset to the * end of the tvbuff. */ - offset = tvb_length(tvb); + offset = tvb_captured_length(tvb); if (session.rtse_reassemble && type == SES_DATA_TRANSFER) { ses_pres_ctx_id = session.pres_ctx_id; ses_rtse_reassemble = TRUE; @@ -1937,7 +1937,7 @@ dissect_ses_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi guint16 len; /* first, check do we have at least 4 bytes (type+length) */ - if (tvb_length(tvb) < 2) + if (tvb_captured_length(tvb) < 2) return FALSE; /* no */ /* can we recognize session PDU ? Return FALSE if not */ @@ -1965,7 +1965,7 @@ dissect_ses_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi * misinterpreted as SES. * the starter in this case is fixed to 0x32 (SES_MINOR_SYNC_ACK for SES), * so if the parameter type is unknown, it's probably SIMATIC */ - if(type == 0x32 && tvb_length(tvb) >= 3) { + if(type == 0x32 && tvb_captured_length(tvb) >= 3) { type = tvb_get_guint8(tvb, offset+2); if (try_val_to_str(type, param_vals) == NULL) { return FALSE; /* it's probably a SIMATIC protocol */ @@ -1979,11 +1979,11 @@ dissect_ses_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi /* add header length */ len+=len_len; /* do we have enough bytes ? */ - if (tvb_length(tvb) < len) + if (tvb_reported_length(tvb) < len) return FALSE; /* no */ /* final check to see if the next SPDU, if present, is also valid */ - if (tvb_length(tvb) > 1+(guint) len) { + if (tvb_captured_length(tvb) > 1+(guint) len) { type = tvb_get_guint8(tvb, offset + len + 1); /* check SPDU type */ if (try_val_to_str(type, ses_vals) == NULL) { |