aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-smb.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-smb.c')
-rw-r--r--epan/dissectors/packet-smb.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c
index 18169cfa22..c433203a7b 100644
--- a/epan/dissectors/packet-smb.c
+++ b/epan/dissectors/packet-smb.c
@@ -920,7 +920,7 @@ static int dissect_smb_command(tvbuff_t *tvb, packet_info *pinfo, int offset, pr
#define END_OF_SMB \
if (bc != 0) { \
gint bc_remaining; \
- bc_remaining = tvb_length_remaining(tvb, offset); \
+ bc_remaining = tvb_captured_length_remaining(tvb, offset); \
if ( ((gint)bc) > bc_remaining) { \
bc = bc_remaining; \
} \
@@ -2617,8 +2617,8 @@ dissect_negprot_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in
* of the security blob.
*/
sbloblen = bc;
- if (sbloblen > tvb_length_remaining(tvb, offset)) {
- sbloblen = tvb_length_remaining(tvb, offset);
+ if (sbloblen > tvb_captured_length_remaining(tvb, offset)) {
+ sbloblen = tvb_captured_length_remaining(tvb, offset);
}
blob_item = proto_tree_add_item(
tree, hf_smb_security_blob,
@@ -4348,7 +4348,7 @@ dissect_file_data(tvbuff_t *tvb, proto_tree *tree, int offset, guint16 bc, guint
offset += bc-datalen;
bc = datalen;
}
- tvblen = tvb_length_remaining(tvb, offset);
+ tvblen = tvb_captured_length_remaining(tvb, offset);
if (bc > tvblen) {
proto_tree_add_bytes_format_value(tree, hf_smb_file_data, tvb, offset, tvblen, NULL, "Incomplete. Only %d of %u bytes", tvblen, bc);
offset += tvblen;
@@ -4374,7 +4374,7 @@ dissect_file_data_dcerpc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += bc-datalen;
bc = datalen;
}
- tvblen = tvb_length_remaining(tvb, offset);
+ tvblen = tvb_captured_length_remaining(tvb, offset);
dcerpc_tvb = tvb_new_subset(tvb, offset, tvblen, bc);
dissect_pipe_dcerpc(dcerpc_tvb, pinfo, top_tree, tree, fid);
if (bc > tvblen)
@@ -4474,7 +4474,7 @@ dissect_read_file_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* feed the export object tap listener */
- tvblen = tvb_length_remaining(tvb, dataoffset);
+ tvblen = tvb_captured_length_remaining(tvb, dataoffset);
if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) {
feed_eo_smb(SMB_COM_READ, fid, tvb, pinfo, dataoffset, datalen, rwi->len, rwi->offset, si);
}
@@ -4602,7 +4602,7 @@ dissect_write_file_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* feed the export object tap listener */
- tvblen = tvb_length_remaining(tvb, dataoffset);
+ tvblen = tvb_captured_length_remaining(tvb, dataoffset);
if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) {
feed_eo_smb(SMB_COM_WRITE, fid, tvb, pinfo, dataoffset, datalen, rwi->len, rwi->offset, si);
}
@@ -6736,7 +6736,7 @@ dissect_read_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* feed the export object tap listener */
- tvblen = tvb_length_remaining(tvb, dataoffset);
+ tvblen = tvb_captured_length_remaining(tvb, dataoffset);
if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) {
feed_eo_smb(SMB_COM_READ_ANDX, fid, tvb, pinfo, dataoffset, datalen, rwi->len, rwi->offset, si);
}
@@ -6912,7 +6912,7 @@ dissect_write_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* feed the export object tap listener */
- tvblen = tvb_length_remaining(tvb, dataoffset);
+ tvblen = tvb_captured_length_remaining(tvb, dataoffset);
if (have_tap_listener(smb_eo_tap) && (datalen == tvblen) && rwi) {
feed_eo_smb(SMB_COM_WRITE_ANDX, fid, tvb, pinfo, dataoffset, datalen, rwi->len, rwi->offset, si);
}
@@ -7179,8 +7179,8 @@ dissect_session_setup_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
* of the security blob.
*/
sbloblen_short = sbloblen;
- if (sbloblen_short > tvb_length_remaining(tvb, offset)) {
- sbloblen_short = tvb_length_remaining(tvb, offset);
+ if (sbloblen_short > tvb_captured_length_remaining(tvb, offset)) {
+ sbloblen_short = tvb_captured_length_remaining(tvb, offset);
}
blob_item = proto_tree_add_item(tree, hf_smb_security_blob,
tvb, offset, sbloblen_short,
@@ -7474,8 +7474,8 @@ dissect_session_setup_andx_response(tvbuff_t *tvb, packet_info *pinfo, proto_tre
* short frames and then we will not see anything at all
* of the security blob.
*/
- if (sbloblen > tvb_length_remaining(tvb, offset)) {
- sbloblen = tvb_length_remaining(tvb, offset);
+ if (sbloblen > tvb_captured_length_remaining(tvb, offset)) {
+ sbloblen = tvb_captured_length_remaining(tvb, offset);
}
blob_item = proto_tree_add_item(tree, hf_smb_security_blob,
tvb, offset, sbloblen, ENC_NA);
@@ -8582,7 +8582,7 @@ dissect_nt_trans_data_request(tvbuff_t *tvb, packet_info *pinfo, int offset, pro
if (parent_tree) {
guint32 bytes = 0;
- bytes = tvb_length_remaining(tvb, offset);
+ bytes = tvb_captured_length_remaining(tvb, offset);
/*tvb_ensure_bytes_exist(tvb, offset, bc);*/
item = proto_tree_add_text(parent_tree, tvb, offset, bytes,
"%s Data",
@@ -8608,7 +8608,7 @@ dissect_nt_trans_data_request(tvbuff_t *tvb, packet_info *pinfo, int offset, pro
break;
case NT_TRANS_IOCTL:
/* ioctl data */
- ioctl_tvb = tvb_new_subset(tvb, offset, MIN((int)bc, tvb_length_remaining(tvb, offset)), bc);
+ ioctl_tvb = tvb_new_subset(tvb, offset, MIN((int)bc, tvb_captured_length_remaining(tvb, offset)), bc);
if (nti) {
dissect_smb2_ioctl_data(ioctl_tvb, pinfo, tree, top_tree_global, nti->ioctl_function, TRUE);
}
@@ -9113,7 +9113,7 @@ dissect_nt_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (pd_tvb) {
/* we have reassembled data, grab param and data from there */
dissect_nt_trans_param_request(pd_tvb, pinfo, 0, tree, tp,
- &ntd, (guint16) tvb_length(pd_tvb), nti, si);
+ &ntd, (guint16) tvb_captured_length(pd_tvb), nti, si);
dissect_nt_trans_data_request(pd_tvb, pinfo, tp, tree, td, &ntd, nti, si);
COUNT_BYTES(bc); /* We are done */
} else {
@@ -9202,7 +9202,7 @@ dissect_nt_trans_data_response(tvbuff_t *tvb, packet_info *pinfo,
break;
case NT_TRANS_IOCTL:
/* ioctl data */
- ioctl_tvb = tvb_new_subset(tvb, offset, MIN((int)len, tvb_length_remaining(tvb, offset)), len);
+ ioctl_tvb = tvb_new_subset(tvb, offset, MIN((int)len, tvb_captured_length_remaining(tvb, offset)), len);
dissect_smb2_ioctl_data(ioctl_tvb, pinfo, tree, top_tree_global, nti->ioctl_function, FALSE);
offset += len;
@@ -9655,7 +9655,7 @@ dissect_nt_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
if (pd_tvb) {
/* we have reassembled data, grab param and data from there */
dissect_nt_trans_param_response(pd_tvb, pinfo, 0, tree, tp,
- &ntd, (guint16) tvb_length(pd_tvb), si);
+ &ntd, (guint16) tvb_captured_length(pd_tvb), si);
dissect_nt_trans_data_response(pd_tvb, pinfo, tp, tree, td, &ntd, nti, si);
COUNT_BYTES(bc); /* We are done */
} else {
@@ -13489,7 +13489,7 @@ dissect_sfsi_request(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
/* security blob */
blob_item = proto_tree_add_item(tree, hf_smb_security_blob,
tvb, offset,
- tvb_length_remaining(tvb, offset),
+ tvb_captured_length_remaining(tvb, offset),
ENC_NA);
/* As an optimization, because Windows is perverse,
@@ -13511,7 +13511,7 @@ dissect_sfsi_request(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
call_dissector(gssapi_handle, blob_tvb, pinfo, blob_tree);
}
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
*bcp = 0;
break;
}
@@ -13542,7 +13542,7 @@ dissect_sfsi_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
/* security blob */
blob_item = proto_tree_add_item(tree, hf_smb_security_blob,
tvb, offset,
- tvb_length_remaining(tvb, offset),
+ tvb_captured_length_remaining(tvb, offset),
ENC_NA);
/* As an optimization, because Windows is perverse,
@@ -13564,7 +13564,7 @@ dissect_sfsi_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
call_dissector(gssapi_handle, blob_tvb, pinfo, blob_tree);
}
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
*bcp = 0;
break;
}
@@ -14054,8 +14054,8 @@ dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
tvbuff_t *sp_tvb, *pd_tvb;
if (pc > 0) {
- if (pc>tvb_length_remaining(tvb, po)) {
- p_tvb = tvb_new_subset(tvb, po, tvb_length_remaining(tvb, po), pc);
+ if (pc>tvb_captured_length_remaining(tvb, po)) {
+ p_tvb = tvb_new_subset(tvb, po, tvb_captured_length_remaining(tvb, po), pc);
} else {
p_tvb = tvb_new_subset_length(tvb, po, pc);
}
@@ -14063,8 +14063,8 @@ dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
p_tvb = NULL;
}
if (dc > 0) {
- if (dc>tvb_length_remaining(tvb, od)) {
- d_tvb = tvb_new_subset(tvb, od, tvb_length_remaining(tvb, od), dc);
+ if (dc>tvb_captured_length_remaining(tvb, od)) {
+ d_tvb = tvb_new_subset(tvb, od, tvb_captured_length_remaining(tvb, od), dc);
} else {
d_tvb = tvb_new_subset_length(tvb, od, dc);
}
@@ -14072,8 +14072,8 @@ dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
d_tvb = NULL;
}
if (sl) {
- if (sl>tvb_length_remaining(tvb, so)) {
- s_tvb = tvb_new_subset(tvb, so, tvb_length_remaining(tvb, so), sl);
+ if (sl>tvb_captured_length_remaining(tvb, so)) {
+ s_tvb = tvb_new_subset(tvb, so, tvb_captured_length_remaining(tvb, so), sl);
} else {
s_tvb = tvb_new_subset_length(tvb, so, sl);
}
@@ -16630,8 +16630,8 @@ dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* if there were any setup bytes, put them in a tvb for later */
if (sc) {
- if ((2*sc) > tvb_length_remaining(tvb, offset)) {
- s_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), 2*sc);
+ if ((2*sc) > tvb_captured_length_remaining(tvb, offset)) {
+ s_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), 2*sc);
} else {
s_tvb = tvb_new_subset_length(tvb, offset, 2*sc);
}
@@ -16700,12 +16700,12 @@ dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if ( (pd == 0) && (dd == 0) ) {
int min;
int reported_min;
- min = MIN(pc, tvb_length_remaining(tvb, po));
+ min = MIN(pc, tvb_captured_length_remaining(tvb, po));
reported_min = MIN(pc, tvb_reported_length_remaining(tvb, po));
if (min && reported_min) {
p_tvb = tvb_new_subset(tvb, po, min, reported_min);
}
- min = MIN(dc, tvb_length_remaining(tvb, od));
+ min = MIN(dc, tvb_captured_length_remaining(tvb, od));
reported_min = MIN(dc, tvb_reported_length_remaining(tvb, od));
if (min && reported_min) {
d_tvb = tvb_new_subset(tvb, od, min, reported_min);
@@ -16715,7 +16715,7 @@ dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
* and the data.
* XXX - check pc and dc as well?
*/
- if (tvb_length_remaining(tvb, po)) {
+ if (tvb_captured_length_remaining(tvb, po)) {
pd_tvb = tvb_new_subset_remaining(tvb, po);
}
}
@@ -18203,7 +18203,7 @@ static gboolean
dissect_smb_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
{
/* must check that this really is a smb packet */
- if (tvb_length(tvb) < 4)
+ if (tvb_captured_length(tvb) < 4)
return FALSE;
if ( (tvb_get_guint8(tvb, 0) != 0xff)