diff options
author | Michael Mann <mmann78@netscape.net> | 2014-06-06 10:35:50 -0400 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2014-06-07 15:41:07 +0000 |
commit | 73217d9f3fbff3d9f5a514cd7f2b7f4ca5f61947 (patch) | |
tree | 194ce9f6db1db1237a755f832d34367d2df8320b /plugins | |
parent | a048dc1d0d33728022831a538d878e967da88901 (diff) |
tvb_new_subset -> tvb_new_subset_length when length parameters are equal.
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is.
Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d
Reviewed-on: https://code.wireshark.org/review/1999
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/docsis/packet-bpkmattr.c | 12 | ||||
-rw-r--r-- | plugins/docsis/packet-macmgmt.c | 2 | ||||
-rw-r--r-- | plugins/docsis/packet-tlv.c | 8 | ||||
-rw-r--r-- | plugins/ethercat/packet-ecatmb.c | 4 | ||||
-rw-r--r-- | plugins/ethercat/packet-esl.c | 4 | ||||
-rw-r--r-- | plugins/ethercat/packet-ethercat-datagram.c | 2 | ||||
-rw-r--r-- | plugins/gryphon/packet-gryphon.c | 2 | ||||
-rw-r--r-- | plugins/irda/packet-ircomm.c | 2 | ||||
-rw-r--r-- | plugins/irda/packet-sir.c | 2 | ||||
-rw-r--r-- | plugins/m2m/packet-m2m.c | 12 | ||||
-rw-r--r-- | plugins/profinet/packet-dcerpc-pn-io.c | 12 | ||||
-rw-r--r-- | plugins/profinet/packet-pn-rt.c | 2 |
12 files changed, 32 insertions, 32 deletions
diff --git a/plugins/docsis/packet-bpkmattr.c b/plugins/docsis/packet-bpkmattr.c index 3d1e3daeea..8347b3cb76 100644 --- a/plugins/docsis/packet-bpkmattr.c +++ b/plugins/docsis/packet-bpkmattr.c @@ -190,7 +190,7 @@ dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) "5 CM Identification"); cmid_tree = proto_item_add_subtree (cmid_it, ett_docsis_bpkmattr_cmid); - cmid_tvb = tvb_new_subset (tvb, pos, length, length); + cmid_tvb = tvb_new_subset_length (tvb, pos, length); dissect_attrs (cmid_tvb, pinfo, cmid_tree); break; case BPKM_DISPLAY_STR: @@ -244,7 +244,7 @@ dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_text (tree, tvb, pos, length, "13 TEK Parameters"); tekp_tree = proto_item_add_subtree (tekp_it, ett_docsis_bpkmattr_tekp); - tekp_tvb = tvb_new_subset (tvb, pos, length, length); + tekp_tvb = tvb_new_subset_length (tvb, pos, length); dissect_attrs (tekp_tvb, pinfo, tekp_tree); break; case BPKM_OBSOLETED: @@ -277,7 +277,7 @@ dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) "19 Security Capabilities"); scap_tree = proto_item_add_subtree (scap_it, ett_docsis_bpkmattr_scap); - scap_tvb = tvb_new_subset (tvb, pos, length, length); + scap_tvb = tvb_new_subset_length (tvb, pos, length); dissect_attrs (scap_tvb, pinfo, scap_tree); break; case BPKM_CRYPTO_SUITE: @@ -303,7 +303,7 @@ dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_text (tree, tvb, pos, length, "23 SA Descriptor"); sadsc_tree = proto_item_add_subtree (sadsc_it, ett_docsis_bpkmattr_sadsc); - sadsc_tvb = tvb_new_subset (tvb, pos, length, length); + sadsc_tvb = tvb_new_subset_length (tvb, pos, length); dissect_attrs (sadsc_tvb, pinfo, sadsc_tree); break; case BPKM_SA_TYPE: @@ -318,7 +318,7 @@ dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_text (tree, tvb, pos, length, "25 SA Query"); saqry_tree = proto_item_add_subtree (saqry_it, ett_docsis_bpkmattr_saqry); - saqry_tvb = tvb_new_subset (tvb, pos, length, length); + saqry_tvb = tvb_new_subset_length (tvb, pos, length); dissect_attrs (saqry_tvb, pinfo, saqry_tree); break; case BPKM_SA_QUERY_TYPE: @@ -345,7 +345,7 @@ dissect_attrs (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) "28 Download Parameters"); dnld_tree = proto_item_add_subtree (dnld_it, ett_docsis_bpkmattr_dnld); - dnld_tvb = tvb_new_subset (tvb, pos, length, length); + dnld_tvb = tvb_new_subset_length (tvb, pos, length); dissect_attrs (dnld_tvb, pinfo, dnld_tree); break; default: diff --git a/plugins/docsis/packet-macmgmt.c b/plugins/docsis/packet-macmgmt.c index fa0c64a6be..8537ffbb5a 100644 --- a/plugins/docsis/packet-macmgmt.c +++ b/plugins/docsis/packet-macmgmt.c @@ -196,7 +196,7 @@ dissect_macmgmt (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) /* sub-dissectors are based on the type field */ type = tvb_get_guint8 (tvb, 18); msg_len = tvb_get_ntohs (tvb, 12); - payload_tvb = tvb_new_subset (tvb, 20, msg_len - 6, msg_len - 6); + payload_tvb = tvb_new_subset_length (tvb, 20, msg_len - 6); if (dissector_try_uint (docsis_mgmt_dissector_table, type, payload_tvb, pinfo, tree)) diff --git a/plugins/docsis/packet-tlv.c b/plugins/docsis/packet-tlv.c index 7b76acaf79..e98f1ab511 100644 --- a/plugins/docsis/packet-tlv.c +++ b/plugins/docsis/packet-tlv.c @@ -2979,7 +2979,7 @@ dissect_tcc(tvbuff_t * tvb, packet_info * pinfo _U_, } break; case TLV_TCC_UCD: - ucd_tvb = tvb_new_subset (tvb, pos, length, length); + ucd_tvb = tvb_new_subset_length (tvb, pos, length); call_dissector (docsis_ucd_handle, ucd_tvb, pinfo, tcc_tree); break; case TLV_TCC_RNG_SID: @@ -3270,7 +3270,7 @@ dissect_rcp(tvbuff_t * tvb, packet_info * pinfo _U_, dissect_rcp_rcv_ch(tvb, rcp_tree, pos, length); break; case TLV_RCP_VEN_SPEC: - vsif_tvb = tvb_new_subset (tvb, pos, length, length); + vsif_tvb = tvb_new_subset_length (tvb, pos, length); call_dissector (docsis_vsif_handle, vsif_tvb, pinfo, rcp_tree); break; } /* switch */ @@ -3510,7 +3510,7 @@ dissect_rcc(tvbuff_t * tvb, packet_info * pinfo _U_, dissect_rcc_rcv_ch(tvb, rcc_tree, pos, length); break; case TLV_RCP_VEN_SPEC: - vsif_tvb = tvb_new_subset (tvb, pos, length, length); + vsif_tvb = tvb_new_subset_length (tvb, pos, length); call_dissector (docsis_vsif_handle, vsif_tvb, pinfo, rcc_tree); break; case TLV_RCC_ERR: @@ -4213,7 +4213,7 @@ dissect_tlv (tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree) } break; case TLV_VENDOR_SPEC: - vsif_tvb = tvb_new_subset (tvb, pos, length, length); + vsif_tvb = tvb_new_subset_length (tvb, pos, length); call_dissector (docsis_vsif_handle, vsif_tvb, pinfo, tlv_tree); break; case TLV_DUT_FILTER: diff --git a/plugins/ethercat/packet-ecatmb.c b/plugins/ethercat/packet-ecatmb.c index a0c93594f4..24e18cdf1e 100644 --- a/plugins/ethercat/packet-ecatmb.c +++ b/plugins/ethercat/packet-ecatmb.c @@ -1083,7 +1083,7 @@ static void dissect_ecat_eoe(tvbuff_t *tvb, gint offset, packet_info *pinfo, pro if ( eoe.anEoeHeaderDataUnion.v.Fragment == 0 ) { - next_tvb = tvb_new_subset(tvb, offset, eoe_length-offset, eoe_length-offset); + next_tvb = tvb_new_subset_length(tvb, offset, eoe_length-offset); call_dissector( eth_handle, next_tvb, pinfo, ecat_eoe_tree); } @@ -1341,7 +1341,7 @@ static void dissect_ecat_mailbox(tvbuff_t *tvb, packet_info *pinfo, proto_tree * else offset+=ETHERCAT_MBOX_HEADER_LEN; - next_tvb = tvb_new_subset (tvb, offset, hdr.Length, hdr.Length); + next_tvb = tvb_new_subset_length (tvb, offset, hdr.Length); switch ( hdr.aControlUnion.v.Type ) { case ETHERCAT_MBOX_TYPE_ADS: diff --git a/plugins/ethercat/packet-esl.c b/plugins/ethercat/packet-esl.c index 6c72034108..c8754818b3 100644 --- a/plugins/ethercat/packet-esl.c +++ b/plugins/ethercat/packet-esl.c @@ -293,10 +293,10 @@ dissect_esl_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data { if ( eth_withoutfcs_handle != NULL ) { - next_tvb = tvb_new_subset(tvb, 0, esl_length-SIZEOF_ESLHEADER, esl_length-SIZEOF_ESLHEADER); + next_tvb = tvb_new_subset_length(tvb, 0, esl_length-SIZEOF_ESLHEADER); call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree); } - next_tvb = tvb_new_subset(tvb, esl_length-SIZEOF_ESLHEADER, SIZEOF_ESLHEADER, SIZEOF_ESLHEADER); + next_tvb = tvb_new_subset_length(tvb, esl_length-SIZEOF_ESLHEADER, SIZEOF_ESLHEADER); dissect_esl_header(next_tvb, pinfo, tree); modify_times(tvb, esl_length-SIZEOF_ESLHEADER, pinfo); diff --git a/plugins/ethercat/packet-ethercat-datagram.c b/plugins/ethercat/packet-ethercat-datagram.c index 2c55934a24..db945f3781 100644 --- a/plugins/ethercat/packet-ethercat-datagram.c +++ b/plugins/ethercat/packet-ethercat-datagram.c @@ -806,7 +806,7 @@ static void dissect_ecat_datagram(tvbuff_t *tvb, packet_info *pinfo, proto_tree { const guint MBoxLength = mbox.Length + 6 /* MBOX header length */; - next_tvb = tvb_new_subset(tvb, suboffset, MBoxLength, MBoxLength); + next_tvb = tvb_new_subset_length(tvb, suboffset, MBoxLength); call_dissector(ecat_mailbox_handle, next_tvb, pinfo, ecat_datagram_tree); if( tree ) diff --git a/plugins/gryphon/packet-gryphon.c b/plugins/gryphon/packet-gryphon.c index eaea3751d1..be0df39ffd 100644 --- a/plugins/gryphon/packet-gryphon.c +++ b/plugins/gryphon/packet-gryphon.c @@ -1638,7 +1638,7 @@ cmd_addresp(tvbuff_t *tvb, int offset, proto_tree *pt) length = msglen + 3 - (msglen + 3) % 4; item = proto_tree_add_text(pt, tvb, offset, length, "Response block %d", i); tree = proto_item_add_subtree (item, ett_gryphon_cmd_response_block); - next_tvb = tvb_new_subset(tvb, offset, msglen, msglen); + next_tvb = tvb_new_subset_length(tvb, offset, msglen); dissect_gryphon_message(next_tvb, NULL, tree, TRUE); offset += length; } diff --git a/plugins/irda/packet-ircomm.c b/plugins/irda/packet-ircomm.c index 0b6f827e87..b89e9b2cab 100644 --- a/plugins/irda/packet-ircomm.c +++ b/plugins/irda/packet-ircomm.c @@ -199,7 +199,7 @@ static void dissect_cooked_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* proto_tree_add_item(ctrl_tree, hf_control_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; { - tvbuff_t *cvalue = tvb_new_subset(tvb, offset, clen, clen); + tvbuff_t *cvalue = tvb_new_subset_length(tvb, offset, clen); call_dissector(data_handle, cvalue, pinfo, ctrl_tree); offset += clen; } diff --git a/plugins/irda/packet-sir.c b/plugins/irda/packet-sir.c index 7f1bcb72af..e91a288867 100644 --- a/plugins/irda/packet-sir.c +++ b/plugins/irda/packet-sir.c @@ -118,7 +118,7 @@ checksum_data(tvbuff_t *tvb, proto_tree *tree) actual_fcs, calculated_fcs); } } - return tvb_new_subset(tvb, 0, len, len); + return tvb_new_subset_length(tvb, 0, len); } diff --git a/plugins/m2m/packet-m2m.c b/plugins/m2m/packet-m2m.c index 5293e084c1..ec90e789e8 100644 --- a/plugins/m2m/packet-m2m.c +++ b/plugins/m2m/packet-m2m.c @@ -411,7 +411,7 @@ static void fch_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint { if(wimax_fch_burst_handle) { /* call FCH dissector */ - call_dissector(wimax_fch_burst_handle, tvb_new_subset(tvb, offset, length, length), pinfo, tree); + call_dissector(wimax_fch_burst_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree); } else /* display FCH info */ { /* update the info column */ @@ -424,7 +424,7 @@ static void cdma_code_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint { if(wimax_cdma_code_burst_handle) { /* call CDMA dissector */ - call_dissector(wimax_cdma_code_burst_handle, tvb_new_subset(tvb, offset, length, length), pinfo, tree); + call_dissector(wimax_cdma_code_burst_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree); } else /* display CDMA Code Attribute info */ { /* update the info column */ @@ -453,7 +453,7 @@ static void pdu_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint } if(frag_type == TLV_NO_FRAG) { /* not fragmented PDU */ - pdu_tvb = tvb_new_subset(tvb, offset, length, length); + pdu_tvb = tvb_new_subset_length(tvb, offset, length); } else /* fragmented PDU */ { /* add the fragment */ @@ -493,7 +493,7 @@ static void fast_feedback_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint of { if(wimax_ffb_burst_handle) { /* display the TLV Fast Feedback Burst dissector info */ - call_dissector(wimax_ffb_burst_handle, tvb_new_subset(tvb, offset, length, length), pinfo, tree); + call_dissector(wimax_ffb_burst_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree); } else /* display the Fast Feedback Burst info */ { /* update the info column */ @@ -505,7 +505,7 @@ static void harq_ack_bursts_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset { if(wimax_hack_burst_handle) { /* call the TLV HARQ ACK Bursts dissector */ - call_dissector(wimax_hack_burst_handle, tvb_new_subset(tvb, offset, length, length), pinfo, tree); + call_dissector(wimax_hack_burst_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree); } else /* display the TLV HARQ ACK Bursts info */ { /* update the info column */ @@ -517,7 +517,7 @@ static void physical_attributes_decoder(proto_tree *tree, tvbuff_t *tvb, gint of { if(wimax_phy_attributes_burst_handle) { /* call the TLV PDU Burst Physical Attributes dissector */ - call_dissector(wimax_phy_attributes_burst_handle, tvb_new_subset(tvb, offset, length, length), pinfo, tree); + call_dissector(wimax_phy_attributes_burst_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree); } else /* display the TLV PDU Burst Physical Attributes info */ { /* update the info column */ diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c index 945a4ca0ca..40979b0ad0 100644 --- a/plugins/profinet/packet-dcerpc-pn-io.c +++ b/plugins/profinet/packet-dcerpc-pn-io.c @@ -4286,7 +4286,7 @@ dissect_PDPortData_Adjust_block(tvbuff_t *tvb, int offset, u16BodyLength -= 6; - new_tvb = tvb_new_subset(tvb, offset, u16BodyLength, u16BodyLength); + new_tvb = tvb_new_subset_length(tvb, offset, u16BodyLength); dissect_blocks(new_tvb, 0, pinfo, tree, drep); offset += u16BodyLength; @@ -4326,7 +4326,7 @@ dissect_PDPortData_Check_block(tvbuff_t *tvb, int offset, u16BodyLength -= 6; - new_tvb = tvb_new_subset(tvb, offset, u16BodyLength, u16BodyLength); + new_tvb = tvb_new_subset_length(tvb, offset, u16BodyLength); dissect_blocks(new_tvb, 0, pinfo, tree, drep); offset += u16BodyLength; @@ -6787,7 +6787,7 @@ dissect_PDInterfaceFSUDataAdjust_block(tvbuff_t *tvb, int offset, u16BodyLength -= 2; /* sub blocks */ - new_tvb = tvb_new_subset(tvb, offset, u16BodyLength, u16BodyLength); + new_tvb = tvb_new_subset_length(tvb, offset, u16BodyLength); dissect_blocks(new_tvb, 0, pinfo, tree, drep); offset += u16BodyLength; @@ -6816,7 +6816,7 @@ dissect_ARFSUDataAdjust_block(tvbuff_t *tvb, int offset, u16BodyLength -= 2; /* sub blocks */ - new_tvb = tvb_new_subset(tvb, offset, u16BodyLength, u16BodyLength); + new_tvb = tvb_new_subset_length(tvb, offset, u16BodyLength); dissect_blocks(new_tvb, 0, pinfo, tree, drep); offset += u16BodyLength; @@ -8047,7 +8047,7 @@ dissect_MultipleBlockHeader_block(tvbuff_t *tvb, int offset, proto_item_append_text(item, ": Api:0x%x Slot:%u Subslot:0x%x", u32Api, u16SlotNr, u16SubslotNr); - new_tvb = tvb_new_subset(tvb, offset, u16BodyLength-10, u16BodyLength-10); + new_tvb = tvb_new_subset_length(tvb, offset, u16BodyLength-10); offset = dissect_blocks(new_tvb, 0, pinfo, tree, drep); /*offset += u16BodyLength;*/ @@ -9156,7 +9156,7 @@ dissect_IODWriteReq(tvbuff_t *tvb, int offset, offset = dissect_IODWriteReq(tvb, offset, pinfo, tree, drep, ar); } } else { - tvbuff_t *new_tvb = tvb_new_subset(tvb, offset, u32RecDataLen, u32RecDataLen); + tvbuff_t *new_tvb = tvb_new_subset_length(tvb, offset, u32RecDataLen); /* RecordDataWrite */ offset += dissect_RecordDataWrite(new_tvb, 0, pinfo, tree, drep, u16Index, u32RecDataLen); diff --git a/plugins/profinet/packet-pn-rt.c b/plugins/profinet/packet-pn-rt.c index a93a4ce2ea..e5189fdba5 100644 --- a/plugins/profinet/packet-pn-rt.c +++ b/plugins/profinet/packet-pn-rt.c @@ -804,7 +804,7 @@ dissect_pn_rt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) pinfo->private_data = GUINT_TO_POINTER( (guint32) u16FrameID); /* get frame user data tvb (without header and footer) */ - next_tvb = tvb_new_subset(tvb, 2, data_len, data_len); + next_tvb = tvb_new_subset_length(tvb, 2, data_len); /* ask heuristics, if some sub-dissector is interested in this packet payload */ if (!dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, &hdtbl_entry, NULL)) { |