diff options
author | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-08-16 12:36:22 +0000 |
---|---|---|
committer | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-08-16 12:36:22 +0000 |
commit | 8b515e9340f9eb93c79b74d129b1fddfb8e5299a (patch) | |
tree | 4a92d1e15649b285aa970ae51790d8e6747ca258 /plugins | |
parent | fe6f8b92c7f1f72a0eb677f01899f1dfa07b5342 (diff) |
Switch a bunch of dissectors over to using tvb_new_subset_remaining()
svn path=/trunk/; revision=29446
Diffstat (limited to 'plugins')
23 files changed, 32 insertions, 32 deletions
diff --git a/plugins/docsis/packet-bpkmreq.c b/plugins/docsis/packet-bpkmreq.c index 8d0702da71..4fe04d215d 100644 --- a/plugins/docsis/packet-bpkmreq.c +++ b/plugins/docsis/packet-bpkmreq.c @@ -104,7 +104,7 @@ dissect_bpkmreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) } /* Code to Call subdissector */ - attrs_tvb = tvb_new_subset (tvb, 4, -1, -1); + attrs_tvb = tvb_new_subset_remaining (tvb, 4); call_dissector (attrs_handle, attrs_tvb, pinfo, tree); diff --git a/plugins/docsis/packet-bpkmrsp.c b/plugins/docsis/packet-bpkmrsp.c index 6daab3df2f..ca3808fda0 100644 --- a/plugins/docsis/packet-bpkmrsp.c +++ b/plugins/docsis/packet-bpkmrsp.c @@ -105,7 +105,7 @@ dissect_bpkmrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) } /* Code to Call subdissector */ - attrs_tvb = tvb_new_subset (tvb, 4, -1, -1); + attrs_tvb = tvb_new_subset_remaining (tvb, 4); call_dissector (attrs_handle, attrs_tvb, pinfo, tree); diff --git a/plugins/docsis/packet-dsaack.c b/plugins/docsis/packet-dsaack.c index d9b6b4d868..43808054e3 100644 --- a/plugins/docsis/packet-dsaack.c +++ b/plugins/docsis/packet-dsaack.c @@ -84,7 +84,7 @@ dissect_dsaack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) FALSE); /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset (tvb, 3, -1, -1); + next_tvb = tvb_new_subset_remaining (tvb, 3); call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsaack_tree); } } diff --git a/plugins/docsis/packet-dsareq.c b/plugins/docsis/packet-dsareq.c index f7670b7ed5..23f1bb66d1 100644 --- a/plugins/docsis/packet-dsareq.c +++ b/plugins/docsis/packet-dsareq.c @@ -76,7 +76,7 @@ dissect_dsareq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) FALSE); /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset (tvb, 2, -1, -1); + next_tvb = tvb_new_subset_remaining (tvb, 2); call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsareq_tree); } diff --git a/plugins/docsis/packet-dsarsp.c b/plugins/docsis/packet-dsarsp.c index 6d4a177ddc..04240a7c91 100644 --- a/plugins/docsis/packet-dsarsp.c +++ b/plugins/docsis/packet-dsarsp.c @@ -84,7 +84,7 @@ dissect_dsarsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) FALSE); /* Call dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset (tvb, 3, -1, -1); + next_tvb = tvb_new_subset_remaining (tvb, 3); call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsarsp_tree); } diff --git a/plugins/docsis/packet-dscack.c b/plugins/docsis/packet-dscack.c index a7b27e7762..bc17155911 100644 --- a/plugins/docsis/packet-dscack.c +++ b/plugins/docsis/packet-dscack.c @@ -83,7 +83,7 @@ dissect_dscack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (dscack_tree, hf_docsis_dscack_response, tvb, 2, 1, FALSE); /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset (tvb, 3, -1, -1); + next_tvb = tvb_new_subset_remaining (tvb, 3); call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscack_tree); } diff --git a/plugins/docsis/packet-dscreq.c b/plugins/docsis/packet-dscreq.c index 18ada3e02c..b1c3ba6879 100644 --- a/plugins/docsis/packet-dscreq.c +++ b/plugins/docsis/packet-dscreq.c @@ -77,7 +77,7 @@ dissect_dscreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) FALSE); /* Call dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset (tvb, 2, -1, -1); + next_tvb = tvb_new_subset_remaining (tvb, 2); call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscreq_tree); } diff --git a/plugins/docsis/packet-dscrsp.c b/plugins/docsis/packet-dscrsp.c index 68d7f52a72..09c3b07610 100644 --- a/plugins/docsis/packet-dscrsp.c +++ b/plugins/docsis/packet-dscrsp.c @@ -85,7 +85,7 @@ dissect_dscrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) FALSE); /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset (tvb, 3, -1, -1); + next_tvb = tvb_new_subset_remaining (tvb, 3); call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscrsp_tree); } } diff --git a/plugins/docsis/packet-dsdreq.c b/plugins/docsis/packet-dsdreq.c index 0be18a9f73..ea3a8dd59f 100644 --- a/plugins/docsis/packet-dsdreq.c +++ b/plugins/docsis/packet-dsdreq.c @@ -82,7 +82,7 @@ dissect_dsdreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) FALSE); /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset (tvb, 8, -1, -1); + next_tvb = tvb_new_subset_remaining (tvb, 8); call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsdreq_tree); } } diff --git a/plugins/docsis/packet-regack.c b/plugins/docsis/packet-regack.c index a4fca36253..0f93cf9967 100644 --- a/plugins/docsis/packet-regack.c +++ b/plugins/docsis/packet-regack.c @@ -83,7 +83,7 @@ dissect_regack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) FALSE); /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset (tvb, 3, -1, -1); + next_tvb = tvb_new_subset_remaining (tvb, 3); call_dissector (docsis_tlv_handle, next_tvb, pinfo, regack_tree); } diff --git a/plugins/docsis/packet-regreq.c b/plugins/docsis/packet-regreq.c index a5a13541e1..5b96cd017a 100644 --- a/plugins/docsis/packet-regreq.c +++ b/plugins/docsis/packet-regreq.c @@ -76,7 +76,7 @@ dissect_regreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (regreq_tree, hf_docsis_regreq_sid, tvb, 0, 2, FALSE); /* Call Dissector for Appendix C TlV's */ - next_tvb = tvb_new_subset (tvb, 2, -1, -1); + next_tvb = tvb_new_subset_remaining (tvb, 2); call_dissector (docsis_tlv_handle, next_tvb, pinfo, regreq_tree); } diff --git a/plugins/docsis/packet-regreqmp.c b/plugins/docsis/packet-regreqmp.c index 663b1fc8a6..2aa8c96526 100644 --- a/plugins/docsis/packet-regreqmp.c +++ b/plugins/docsis/packet-regreqmp.c @@ -76,7 +76,7 @@ dissect_regreqmp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (regreqmp_tree, hf_docsis_regreqmp_fragment_sequence_number, tvb, 3, 1, FALSE); /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset (tvb, 4, -1, -1); + next_tvb = tvb_new_subset_remaining (tvb, 4); call_dissector (docsis_tlv_handle, next_tvb, pinfo, regreqmp_tree); } } diff --git a/plugins/docsis/packet-regrsp.c b/plugins/docsis/packet-regrsp.c index aa51d1767e..1c366752a7 100644 --- a/plugins/docsis/packet-regrsp.c +++ b/plugins/docsis/packet-regrsp.c @@ -84,7 +84,7 @@ dissect_regrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (regrsp_tree, hf_docsis_regrsp_response, tvb, 2, 1, FALSE); /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset (tvb, 3, -1, -1); + next_tvb = tvb_new_subset_remaining (tvb, 3); call_dissector (docsis_tlv_handle, next_tvb, pinfo, regrsp_tree); } diff --git a/plugins/docsis/packet-regrspmp.c b/plugins/docsis/packet-regrspmp.c index e3403895b5..3861e79b4f 100644 --- a/plugins/docsis/packet-regrspmp.c +++ b/plugins/docsis/packet-regrspmp.c @@ -82,7 +82,7 @@ dissect_regrspmp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_item (regrspmp_tree, hf_docsis_regrspmp_fragment_sequence_number, tvb, 4, 1, FALSE); /* Call Dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset (tvb, 5, -1, -1); + next_tvb = tvb_new_subset_remaining (tvb, 5); call_dissector (docsis_tlv_handle, next_tvb, pinfo, regrspmp_tree); } } diff --git a/plugins/docsis/packet-uccreq.c b/plugins/docsis/packet-uccreq.c index 781496813f..5490db5a9d 100644 --- a/plugins/docsis/packet-uccreq.c +++ b/plugins/docsis/packet-uccreq.c @@ -77,7 +77,7 @@ dissect_uccreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) FALSE); /* call dissector for Appendix C TLV's */ - next_tvb = tvb_new_subset (tvb, 1, -1, -1); + next_tvb = tvb_new_subset_remaining (tvb, 1); call_dissector (docsis_tlv_handle, next_tvb, pinfo, uccreq_tree); } diff --git a/plugins/ethercat/packet-esl.c b/plugins/ethercat/packet-esl.c index fd2ca16d83..4cd25c6bae 100644 --- a/plugins/ethercat/packet-esl.c +++ b/plugins/ethercat/packet-esl.c @@ -197,7 +197,7 @@ dissect_esl_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) dissect_esl_header(tvb, pinfo, tree); if ( eth_withoutfcs_handle != NULL ) { - next_tvb = tvb_new_subset(tvb, SIZEOF_ESLHEADER, -1, -1); + next_tvb = tvb_new_subset_remaining(tvb, SIZEOF_ESLHEADER); call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree); } modify_times(tvb, 0, pinfo); diff --git a/plugins/ethercat/packet-ethercat-frame.c b/plugins/ethercat/packet-ethercat-frame.c index b3ce57f186..b340b6154a 100644 --- a/plugins/ethercat/packet-ethercat-frame.c +++ b/plugins/ethercat/packet-ethercat-frame.c @@ -100,7 +100,7 @@ static void dissect_ethercat_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree /* The EtherCAT frame header has now been processed, allow sub dissectors to handle the rest of the PDU. */ - next_tvb = tvb_new_subset (tvb, offset, -1, -1); + next_tvb = tvb_new_subset_remaining (tvb, offset); if (!dissector_try_port(ethercat_frame_dissector_table, hdr.v.protocol, next_tvb, pinfo, tree)) diff --git a/plugins/irda/packet-ircomm.c b/plugins/irda/packet-ircomm.c index a2340f42ba..77c81d766a 100644 --- a/plugins/irda/packet-ircomm.c +++ b/plugins/irda/packet-ircomm.c @@ -213,7 +213,7 @@ static void dissect_cooked_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* offset += clen; } - tvb = tvb_new_subset(tvb, offset, -1, -1); + tvb = tvb_new_subset_remaining(tvb, offset); call_dissector(data_handle, tvb, pinfo, tree); } } diff --git a/plugins/irda/packet-irda.c b/plugins/irda/packet-irda.c index 6361383426..b0f0aec5a9 100644 --- a/plugins/irda/packet-irda.c +++ b/plugins/irda/packet-irda.c @@ -662,7 +662,7 @@ static void dissect_iap_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree* r } /* If any bytes remain, send it to the generic data dissector */ - tvb = tvb_new_subset(tvb, offset, -1, -1); + tvb = tvb_new_subset_remaining(tvb, offset); call_dissector(data_handle, tvb, pinfo, root); } @@ -919,7 +919,7 @@ static void dissect_iap_result(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro } /* If any bytes remain, send it to the generic data dissector */ - tvb = tvb_new_subset(tvb, offset, -1, -1); + tvb = tvb_new_subset_remaining(tvb, offset); call_dissector(data_handle, tvb, pinfo, root); } @@ -1030,7 +1030,7 @@ static void dissect_appl_proto(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro { offset += dissect_ttp(tvb, pinfo, root, (pdu_type == DATA_PDU)); - tvb = tvb_new_subset(tvb, offset, -1, -1); + tvb = tvb_new_subset_remaining(tvb, offset); } pinfo->private_data = (void *)pdu_type; @@ -1150,7 +1150,7 @@ static void dissect_irlmp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) } } - tvb = tvb_new_subset(tvb, offset, -1, -1); + tvb = tvb_new_subset_remaining(tvb, offset); proto_item_set_len(tree, offset); } else @@ -1179,7 +1179,7 @@ static void dissect_irlmp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) } } - tvb = tvb_new_subset(tvb, offset, -1, -1); + tvb = tvb_new_subset_remaining(tvb, offset); } if (cbit == 0) @@ -1792,7 +1792,7 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) if ((c & XDLC_I_MASK) == XDLC_I) { /* I frame */ proto_item_set_len(tree, offset); - tvb = tvb_new_subset(tvb, offset, -1, -1); + tvb = tvb_new_subset_remaining(tvb, offset); dissect_irlmp(tvb, pinfo, root); return; } @@ -1845,7 +1845,7 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) break; case IRDA_XID_CMD: - tvb = tvb_new_subset(tvb, offset, -1, -1); + tvb = tvb_new_subset_remaining(tvb, offset); dissect_xid(tvb, pinfo, root, tree, TRUE); return; @@ -1879,7 +1879,7 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) break; case XDLC_XID: - tvb = tvb_new_subset(tvb, offset, -1, -1); + tvb = tvb_new_subset_remaining(tvb, offset); dissect_xid(tvb, pinfo, root, tree, FALSE); return; } @@ -1888,7 +1888,7 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) /* If any bytes remain, send it to the generic data dissector */ if (tvb_reported_length_remaining(tvb, offset) > 0) { - tvb = tvb_new_subset(tvb, offset, -1, -1); + tvb = tvb_new_subset_remaining(tvb, offset); call_dissector(data_handle, tvb, pinfo, root); } } diff --git a/plugins/profinet/packet-dcom-cba-acco.c b/plugins/profinet/packet-dcom-cba-acco.c index 83bf8e6cbf..adf1c8953b 100644 --- a/plugins/profinet/packet-dcom-cba-acco.c +++ b/plugins/profinet/packet-dcom-cba-acco.c @@ -3266,7 +3266,7 @@ dissect_ICBAAccoCallback_OnDataChanged_rqst(tvbuff_t *tvb, int offset, /*** the data below is NOT ndr encoded (especially NOT aligned)!!! ***/ /* dissect PROFINET component data (without header) */ - next_tvb = tvb_new_subset(tvb, offset, -1, -1); + next_tvb = tvb_new_subset_remaining(tvb, offset); offset += dissect_CBA_Connection_Data(next_tvb, pinfo, tree, cons_ldev, NULL /* frame */); @@ -3424,7 +3424,7 @@ dissect_ICBAAccoServer2_GetConnectionData_resp(tvbuff_t *tvb, int offset, /*** the data below is NOT ndr encoded (especially NOT aligned)!!! ***/ /* dissect PROFINET component data (without header) */ - next_tvb = tvb_new_subset(tvb, offset, -1, -1); + next_tvb = tvb_new_subset_remaining(tvb, offset); offset += dissect_CBA_Connection_Data(next_tvb, pinfo, tree, (call != NULL) ? *call : NULL, NULL /* frame */); diff --git a/plugins/profinet/packet-pn-mrp.c b/plugins/profinet/packet-pn-mrp.c index 2f03ef73d6..2aff5279c4 100644 --- a/plugins/profinet/packet-pn-mrp.c +++ b/plugins/profinet/packet-pn-mrp.c @@ -326,7 +326,7 @@ dissect_PNMRP_PDU(tvbuff_t *tvb, int offset, /* the rest of the packet has 4byte alignment regarding to the beginning of the next TLV block! */ /* XXX - do we have to free this new tvb below? */ - tvb_new = tvb_new_subset(tvb, offset, -1, -1); + tvb_new = tvb_new_subset_remaining(tvb, offset); offset = 0; for(i=0; tvb_length_remaining(tvb, offset) > 0; i++) { diff --git a/plugins/sercosiii/packet-sercosiii_1v1_at.c b/plugins/sercosiii/packet-sercosiii_1v1_at.c index 28f5bd3ddc..327b68b43c 100644 --- a/plugins/sercosiii/packet-sercosiii_1v1_at.c +++ b/plugins/sercosiii/packet-sercosiii_1v1_at.c @@ -177,7 +177,7 @@ void dissect_siii_at(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case COMMUNICATION_PHASE_3: /* CP3 */ case COMMUNICATION_PHASE_4: /* CP4 */ - tvb_n = tvb_new_subset(tvb, 6, -1, -1); + tvb_n = tvb_new_subset_remaining(tvb, 6); dissect_siii_at_cp3_4(tvb_n, pinfo, subtree, telno); break; diff --git a/plugins/sercosiii/packet-sercosiii_1v1_mdt.c b/plugins/sercosiii/packet-sercosiii_1v1_mdt.c index 88e20062dc..eb9824be7a 100644 --- a/plugins/sercosiii/packet-sercosiii_1v1_mdt.c +++ b/plugins/sercosiii/packet-sercosiii_1v1_mdt.c @@ -176,7 +176,7 @@ void dissect_siii_mdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case COMMUNICATION_PHASE_3: /* CP3 */ case COMMUNICATION_PHASE_4: /* CP4 */ - tvb_n = tvb_new_subset(tvb, 6, -1, -1); + tvb_n = tvb_new_subset_remaining(tvb, 6); dissect_siii_mdt_cp3_4(tvb_n, pinfo, subtree, telno); break; |