aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorEvan Huus <evan.huus@jadedpixel.com>2014-06-19 19:55:27 +0000
committerEvan Huus <eapache@gmail.com>2014-06-19 19:56:32 +0000
commit15a0a6315641cba55363ba6ef4769b27ffc90ccb (patch)
tree6966531d85b225e3d3adbeb10474c2aac67fb67e /epan
parent78a5f0c1d89a39d103b99d4d618418cd1b81f496 (diff)
batch of manual tvb_length conversions
Change-Id: Ifea45514bdba8be5f62b9dc560027077297f631e Reviewed-on: https://code.wireshark.org/review/2456 Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-credssp.c2
-rw-r--r--epan/dissectors/packet-disp.c4
-rw-r--r--epan/dissectors/packet-dop.c4
-rw-r--r--epan/dissectors/packet-dsp.c4
-rw-r--r--epan/dissectors/packet-ess.c4
-rw-r--r--epan/dissectors/packet-gnm.c13
-rw-r--r--epan/dissectors/packet-gnm.h1
-rw-r--r--epan/dissectors/packet-gsm_map.c6
-rw-r--r--epan/dissectors/packet-h225.c4
-rw-r--r--epan/dissectors/packet-isdn-sup.c2
10 files changed, 23 insertions, 21 deletions
diff --git a/epan/dissectors/packet-credssp.c b/epan/dissectors/packet-credssp.c
index cf95f40d63..8531c59b43 100644
--- a/epan/dissectors/packet-credssp.c
+++ b/epan/dissectors/packet-credssp.c
@@ -366,7 +366,7 @@ dissect_credssp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
/* Look for SEQUENCE, CONTEXT 0, and INTEGER 2 */
- if(tvb_length(tvb) > 7) {
+ if(tvb_captured_length(tvb) > 7) {
offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
if((ber_class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_SEQUENCE) && (pc == TRUE)) {
offset = get_ber_length(tvb, offset, NULL, NULL);
diff --git a/epan/dissectors/packet-disp.c b/epan/dissectors/packet-disp.c
index 884d5f729d..1e8e829faf 100644
--- a/epan/dissectors/packet-disp.c
+++ b/epan/dissectors/packet-disp.c
@@ -1570,7 +1570,7 @@ dissect_disp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
break;
default:
proto_tree_add_text(tree, tvb, offset, -1,"Unsupported DISP PDU");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if(disp_dissector) {
@@ -1586,7 +1586,7 @@ dissect_disp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-dop.c b/epan/dissectors/packet-dop.c
index 3b43aedc0a..2aa0fb5ed9 100644
--- a/epan/dissectors/packet-dop.c
+++ b/epan/dissectors/packet-dop.c
@@ -2141,7 +2141,7 @@ dissect_dop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
break;
default:
proto_tree_add_text(tree, tvb, offset, -1,"Unsupported DOP PDU");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if(dop_dissector) {
@@ -2157,7 +2157,7 @@ dissect_dop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-dsp.c b/epan/dissectors/packet-dsp.c
index 5ffdade71e..89ceeee9e2 100644
--- a/epan/dissectors/packet-dsp.c
+++ b/epan/dissectors/packet-dsp.c
@@ -1859,7 +1859,7 @@ dissect_dsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
break;
default:
proto_tree_add_text(tree, tvb, offset, -1,"Unsupported DSP PDU");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if(dsp_dissector) {
@@ -1875,7 +1875,7 @@ dissect_dsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-ess.c b/epan/dissectors/packet-ess.c
index db51222599..95ab745498 100644
--- a/epan/dissectors/packet-ess.c
+++ b/epan/dissectors/packet-ess.c
@@ -263,13 +263,13 @@ ess_dissect_attribute_flags (tvbuff_t *tvb, asn1_ctx_t *actx)
guint i;
tree = proto_item_add_subtree (actx->created_item, ett_Category_attributes);
- value = (guint8 *)tvb_memdup (wmem_packet_scope(), tvb, 0, tvb_length (tvb));
+ value = (guint8 *)tvb_memdup (wmem_packet_scope(), tvb, 0, tvb_captured_length (tvb));
for (i = 0; i < num_ess_category_attributes; i++) {
ess_category_attributes_t *u = &(ess_category_attributes[i]);
if ((strcmp (u->oid, object_identifier_id) == 0) &&
- ((u->lacv / 8) < tvb_length (tvb)) &&
+ ((u->lacv / 8) < tvb_captured_length (tvb)) &&
(value[u->lacv / 8] & (1 << (7 - (u->lacv % 8)))))
{
proto_tree_add_string_format (tree, hf_ess_Category_attribute, tvb,
diff --git a/epan/dissectors/packet-gnm.c b/epan/dissectors/packet-gnm.c
index 4e583db50d..30a5f6b674 100644
--- a/epan/dissectors/packet-gnm.c
+++ b/epan/dissectors/packet-gnm.c
@@ -10,6 +10,7 @@
* Routines for GENERIC NETWORK INFORMATION MODEL Data dissection
*
* Copyright 2005 , Anders Broman <anders.broman [AT] ericsson.com>
+ *
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
@@ -226,7 +227,7 @@ static int hf_gnm_TransmissionCharacteristics_dCME = -1;
static int hf_gnm_TransmissionCharacteristics_echoControl = -1;
/*--- End of included file: packet-gnm-hf.c ---*/
-#line 51 "../../asn1/gnm/packet-gnm-template.c"
+#line 50 "../../asn1/gnm/packet-gnm-template.c"
/* Initialize the subtree pointers */
@@ -300,7 +301,7 @@ static gint ett_gnm_TpsInGtpList = -1;
static gint ett_gnm_TransmissionCharacteristics = -1;
/*--- End of included file: packet-gnm-ett.c ---*/
-#line 54 "../../asn1/gnm/packet-gnm-template.c"
+#line 53 "../../asn1/gnm/packet-gnm-template.c"
/*--- Included file: packet-gnm-fn.c ---*/
@@ -2028,7 +2029,7 @@ static void dissect_Version_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto
/*--- End of included file: packet-gnm-fn.c ---*/
-#line 56 "../../asn1/gnm/packet-gnm-template.c"
+#line 55 "../../asn1/gnm/packet-gnm-template.c"
@@ -2728,7 +2729,7 @@ void proto_register_gnm(void) {
NULL, HFILL }},
/*--- End of included file: packet-gnm-hfarr.c ---*/
-#line 83 "../../asn1/gnm/packet-gnm-template.c"
+#line 82 "../../asn1/gnm/packet-gnm-template.c"
};
/* List of subtrees */
@@ -2804,7 +2805,7 @@ void proto_register_gnm(void) {
&ett_gnm_TransmissionCharacteristics,
/*--- End of included file: packet-gnm-ettarr.c ---*/
-#line 88 "../../asn1/gnm/packet-gnm-template.c"
+#line 87 "../../asn1/gnm/packet-gnm-template.c"
};
/* Register protocol */
@@ -2893,7 +2894,7 @@ void proto_reg_handoff_gnm(void) {
/*--- End of included file: packet-gnm-dis-tab.c ---*/
-#line 103 "../../asn1/gnm/packet-gnm-template.c"
+#line 102 "../../asn1/gnm/packet-gnm-template.c"
/* Wrapper to call CMIP */
register_ber_oid_dissector("0.0.13.3100.0.7.9", dissect_gnm_attribute_ObjectInstance, proto_gnm, "clientConnection(9)");
register_ber_oid_dissector("0.0.13.3100.0.7.10", dissect_gnm_attribute_ObjectInstance, proto_gnm, "clientTrail(10)");
diff --git a/epan/dissectors/packet-gnm.h b/epan/dissectors/packet-gnm.h
index 22af467c12..d1bb01096d 100644
--- a/epan/dissectors/packet-gnm.h
+++ b/epan/dissectors/packet-gnm.h
@@ -10,6 +10,7 @@
* Routines for GENERIC NETWORK INFORMATION MODEL Data dissection
*
* Copyright 2005 , Anders Broman <anders.broman [AT] ericsson.com>
+ *
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
diff --git a/epan/dissectors/packet-gsm_map.c b/epan/dissectors/packet-gsm_map.c
index 84580d8191..21502e1fc4 100644
--- a/epan/dissectors/packet-gsm_map.c
+++ b/epan/dissectors/packet-gsm_map.c
@@ -2744,7 +2744,7 @@ unpack_digits(tvbuff_t *tvb, int offset) {
int i=0;
char *digit_str;
- length = tvb_length(tvb);
+ length = tvb_reported_length(tvb);
if (length < offset)
return "";
digit_str = (char *)wmem_alloc(wmem_packet_scope(), (length - offset)*2+1);
@@ -3248,7 +3248,7 @@ dissect_gsm_map_msisdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
proto_tree_add_item(tree, hf_gsm_map_nature_of_number, tvb, 0,1,ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_gsm_map_number_plan, tvb, 0,1,ENC_BIG_ENDIAN);
- if(tvb_length(tvb)==1)
+ if(tvb_reported_length(tvb)==1)
return;
digit_str = unpack_digits(tvb, 1);
@@ -22055,7 +22055,7 @@ dissect_gsm_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void
tap_queue_packet(gsm_map_tap, pinfo, &tap_rec);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
const value_string ssCode_vals[] = {
diff --git a/epan/dissectors/packet-h225.c b/epan/dissectors/packet-h225.c
index ae708fd52b..ac973118e1 100644
--- a/epan/dissectors/packet-h225.c
+++ b/epan/dissectors/packet-h225.c
@@ -7539,7 +7539,7 @@ dissect_h225_H323UserInformation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
col_clear(pinfo->cinfo, COL_INFO);
- it=proto_tree_add_protocol_format(tree, proto_h225, tvb, 0, tvb_length(tvb), PSNAME" CS");
+ it=proto_tree_add_protocol_format(tree, proto_h225, tvb, 0, tvb_captured_length(tvb), PSNAME" CS");
tr=proto_item_add_subtree(it, ett_h225);
offset = dissect_H323_UserInformation_PDU(tvb, pinfo, tr, NULL);
@@ -7574,7 +7574,7 @@ dissect_h225_h225_RasMessage(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
- it=proto_tree_add_protocol_format(tree, proto_h225, tvb, offset, tvb_length(tvb), PSNAME" RAS");
+ it=proto_tree_add_protocol_format(tree, proto_h225, tvb, offset, tvb_captured_length(tvb), PSNAME" RAS");
tr=proto_item_add_subtree(it, ett_h225);
offset = dissect_RasMessage_PDU(tvb, pinfo, tr, NULL);
diff --git a/epan/dissectors/packet-isdn-sup.c b/epan/dissectors/packet-isdn-sup.c
index 81b7d2233e..315794ccc1 100644
--- a/epan/dissectors/packet-isdn-sup.c
+++ b/epan/dissectors/packet-isdn-sup.c
@@ -1,7 +1,7 @@
/* Do not modify this file. Changes will be overwritten. */
/* Generated automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-isdn-sup.c */
-/* ../../tools/asn2wrs.py -b -p isdn-sup -c ./isdn-sup.cnf -s ./packet-isdn-sup-template -D . -O ../../epan/dissectors Addressing-Data-Elements.asn Basic-Service-Elements.asn Embedded-Q931-Types.asn General-Errors.asn Advice-of-Charge-Operations.asn Closed-User-Group-Service-Operations.asn Conference-Add-On-Operations.asn Diversion-Operations.asn MCID-Operations.asn User-To-User-Signalling-Operations.asn Freephone-Operations.asn */
+/* ../../tools/asn2wrs.py -b -k -p isdn-sup -c ./isdn-sup.cnf -s ./packet-isdn-sup-template -D . -O ../../epan/dissectors Addressing-Data-Elements.asn Basic-Service-Elements.asn Embedded-Q931-Types.asn General-Errors.asn Advice-of-Charge-Operations.asn Closed-User-Group-Service-Operations.asn Conference-Add-On-Operations.asn Diversion-Operations.asn MCID-Operations.asn User-To-User-Signalling-Operations.asn Freephone-Operations.asn */
/* Input file: packet-isdn-sup-template.c */