aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/ldap
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2014-06-19 20:31:08 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2014-06-19 18:42:28 +0000
commitd0ac93756794ed29650dc91f7f8304b11504c61b (patch)
treeca84581f86ad0d451a9600533a57b4f56e261fa0 /asn1/ldap
parent7398779206eb53ec17bf2f4f4f7fad414b0c7391 (diff)
Revert "Update ASN.1 source files with the API changes done in g021e7af"
This reverts commit e308e7c4de81c2ff7159e444b865ac59de4faa2b. Change-Id: I079616d63f643f79f1bc03ef5fdf724f36df4071 Reviewed-on: https://code.wireshark.org/review/2435 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'asn1/ldap')
-rw-r--r--asn1/ldap/ldap.cnf38
-rw-r--r--asn1/ldap/packet-ldap-template.c34
2 files changed, 36 insertions, 36 deletions
diff --git a/asn1/ldap/ldap.cnf b/asn1/ldap/ldap.cnf
index d7cb4dc7e6..dfad13183f 100644
--- a/asn1/ldap/ldap.cnf
+++ b/asn1/ldap/ldap.cnf
@@ -65,7 +65,7 @@ PasswordPolicyResponseValue B "1.3.6.1.4.1.42.2.27.8.5.1" "passwordPolicy"
if (!parameter_tvb)
return offset;
- object_identifier_id = tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, tvb_captured_length_remaining(parameter_tvb,0), ENC_UTF_8|ENC_NA);
+ object_identifier_id = tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), ENC_UTF_8|ENC_NA);
name = oid_resolved_from_string(object_identifier_id);
if(name){
@@ -194,7 +194,7 @@ char *mechanism = NULL;
* different type and/or mechanism.
*/
if(!actx->pinfo->fd->flags.visited) {
- mechanism = tvb_get_string_enc(NULL, parameter_tvb, 0, tvb_captured_length_remaining(parameter_tvb,0), ENC_UTF_8|ENC_NA);
+ mechanism = tvb_get_string_enc(NULL, parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), ENC_UTF_8|ENC_NA);
ldap_info->first_auth_frame = 0; /* not known until we see the bind reply */
/*
* If the mechanism in this request is an empty string (which is
@@ -232,7 +232,7 @@ gint32 tag;
* All SPNEGO PDUs are of class CONSTRUCTED while
* GSS PDUs are class APPLICATION
*/
- if (parameter_tvb && (tvb_captured_length(parameter_tvb) > 0))
+ if (parameter_tvb && (tvb_length(parameter_tvb) > 0))
call_dissector(spnego_handle, parameter_tvb, actx->pinfo, tree);
}
/*if ((ldap_info->auth_mech != NULL) && ((strcmp(ldap_info->auth_mech, "GSSAPI") == 0) || (ber_class==BER_CLASS_APP))) {*/
@@ -240,7 +240,7 @@ gint32 tag;
/*
* This is a raw GSS-API token.
*/
- if (parameter_tvb && (tvb_captured_length(parameter_tvb) > 0)) {
+ if (parameter_tvb && (tvb_length(parameter_tvb) > 0)) {
call_dissector(gssapi_handle, parameter_tvb, actx->pinfo, tree);
}
}
@@ -296,7 +296,7 @@ ldap_conv_info_t *ldap_info;
* which might not be wrapped in GSS-SPNEGO but be a raw
* NTLMSSP blob
*/
- if ( (tvb_captured_length(parameter_tvb)>=7)
+ if ( (tvb_length(parameter_tvb)>=7)
&& (!tvb_memeql(parameter_tvb, 0, "NTLMSSP", 7))){
call_dissector(ntlmssp_handle, parameter_tvb, actx->pinfo, tree);
break;
@@ -304,14 +304,14 @@ ldap_conv_info_t *ldap_info;
/*
* This is a GSS-API token.
*/
- if(parameter_tvb && (tvb_captured_length(parameter_tvb) > 0))
+ if(parameter_tvb && (tvb_length(parameter_tvb) > 0))
call_dissector(spnego_handle, parameter_tvb, actx->pinfo, tree);
} else if (ldap_info->auth_mech != NULL &&
strcmp(ldap_info->auth_mech, "GSSAPI") == 0) {
/*
* This is a GSS-API token.
*/
- if(parameter_tvb && (tvb_captured_length(parameter_tvb) > 0))
+ if(parameter_tvb && (tvb_length(parameter_tvb) > 0))
call_dissector(gssapi_handle, parameter_tvb, actx->pinfo, tree);
}
break;
@@ -330,7 +330,7 @@ ldap_conv_info_t *ldap_info;
ldap_do_protocolop(actx->pinfo);
if(parameter_tvb)
- ldapstring = tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, tvb_captured_length_remaining(parameter_tvb, 0), ENC_UTF_8|ENC_NA);
+ ldapstring = tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 0, tvb_length_remaining(parameter_tvb, 0), ENC_UTF_8|ENC_NA);
if(hf_index == hf_ldap_baseObject) {
/* this is search - put it on the scanline */
@@ -469,7 +469,7 @@ ldap_conv_info_t *ldap_info;
/* first check if we have a custom attribute type configured */
if ((hf_id = get_hf_for_header (attr_type)) != NULL)
- proto_tree_add_item (tree, *hf_id, next_tvb, 0, tvb_captured_length_remaining(next_tvb, 0), ENC_UTF_8|ENC_NA);
+ proto_tree_add_item (tree, *hf_id, next_tvb, 0, tvb_length_remaining(next_tvb, 0), ENC_UTF_8|ENC_NA);
/* if we have an attribute type that isn't binary see if there is a better dissector */
else if(!attr_type || !next_tvb || !dissector_try_string(ldap_name_dissector_table, attr_type, next_tvb, actx->pinfo, tree, NULL)) {
@@ -478,14 +478,14 @@ ldap_conv_info_t *ldap_info;
/* do the default thing */
%(DEFAULT_BODY)s
- len = tvb_captured_length_remaining(next_tvb, 0);
+ len = tvb_length_remaining(next_tvb, 0);
for(i = 0; i < len; i++)
if(!g_ascii_isprint(tvb_get_guint8(next_tvb, i)))
break;
if(i == len) {
- string = tvb_get_string_enc(wmem_packet_scope(), next_tvb, 0, tvb_captured_length_remaining(next_tvb, 0), ENC_ASCII|ENC_NA);
+ string = tvb_get_string_enc(wmem_packet_scope(), next_tvb, 0, tvb_length_remaining(next_tvb, 0), ENC_ASCII|ENC_NA);
proto_item_set_text(actx->created_item, "AttributeValue: %%s", string);
}
}
@@ -572,7 +572,7 @@ ldap_conv_info_t *ldap_info;
and_filter_string=NULL;
if(tree){
- it=proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "and: ");
+ it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "and: ");
tr=proto_item_add_subtree(it, ett_ldap_T_and);
tree = tr;
}
@@ -600,7 +600,7 @@ ldap_conv_info_t *ldap_info;
or_filter_string=NULL;
if(tree){
- it=proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "or: ");
+ it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "or: ");
tr=proto_item_add_subtree(it, ett_ldap_T_or);
tree = tr;
}
@@ -665,7 +665,7 @@ offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, &v
substring_item_any=NULL;
substring_item_final=NULL;
if(tree){
- it=proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "substring: ");
+ it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "substring: ");
tr=proto_item_add_subtree(it, ett_ldap_SubstringFilter);
tree = tr;
}
@@ -692,7 +692,7 @@ offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, &v
}
if(tree){
- it=proto_tree_add_text(tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "Filter: ");
+ it=proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "Filter: ");
tr=proto_item_add_subtree(it, ett_ldap_Filter);
tree = tr;
}
@@ -705,14 +705,14 @@ offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, &v
ldap_do_protocolop(actx->pinfo);
call_dissector(ntlmssp_handle, tvb, actx->pinfo, tree);
- offset+=tvb_captured_length_remaining(tvb, offset);
+ offset+=tvb_length_remaining(tvb, offset);
#.FN_BODY AuthenticationChoice/ntlmsspAuth
/* make sure the protocol op comes first */
ldap_do_protocolop(actx->pinfo);
call_dissector(ntlmssp_handle, tvb, actx->pinfo, tree);
- offset+=tvb_captured_length_remaining(tvb, offset);
+ offset+=tvb_length_remaining(tvb, offset);
#.FN_BODY BindResponse/_untag/matchedDN
tvbuff_t *new_tvb=NULL;
@@ -720,7 +720,7 @@ offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, &v
offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_ldap_matchedDN, &new_tvb);
if( new_tvb
- && (tvb_captured_length(new_tvb)>=7)
+ && (tvb_length(new_tvb)>=7)
&& (!tvb_memeql(new_tvb, 0, "NTLMSSP", 7))){
/* make sure the protocol op comes first */
@@ -787,7 +787,7 @@ offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, &v
dissect_ber_identifier(actx->pinfo, tree, tvb, otheroffset, &ber_class, &pc, &tag);
otheroffset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, NULL);
} else {
- gint32 remaining=tvb_captured_length_remaining(tvb, offset);
+ gint32 remaining=tvb_length_remaining(tvb, offset);
len=remaining>0 ? remaining : 0;
}
diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c
index 8ab2c56afe..d97ca666b1 100644
--- a/asn1/ldap/packet-ldap-template.c
+++ b/asn1/ldap/packet-ldap-template.c
@@ -604,7 +604,7 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, as
offset=get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
offset=get_ber_length(tvb, offset, &len, &ind);
} else {
- len=tvb_captured_length_remaining(tvb,offset);
+ len=tvb_length_remaining(tvb,offset);
}
if(len==0){
@@ -914,7 +914,7 @@ dissect_ldap_payload(tvbuff_t *tvb, packet_info *pinfo,
one_more_pdu:
- length_remaining = tvb_ensure_captured_length_remaining(tvb, offset);
+ length_remaining = tvb_ensure_length_remaining(tvb, offset);
if (length_remaining < 6) return;
@@ -984,7 +984,7 @@ one_more_pdu:
/* If this was a sasl blob there might be another PDU following in the
* same blob
*/
- if(tvb_captured_length_remaining(tvb, offset)>=6){
+ if(tvb_length_remaining(tvb, offset)>=6){
tvb = tvb_new_subset_remaining(tvb, offset);
offset = 0;
@@ -1067,7 +1067,7 @@ static void
}
}
- length_remaining = tvb_ensure_captured_length_remaining(tvb, offset);
+ length_remaining = tvb_ensure_length_remaining(tvb, offset);
/* It might still be a packet containing a SASL security layer
* but it's just that we never saw the BIND packet.
@@ -1191,7 +1191,7 @@ static void
* the token, from which we compute the offset in the tvbuff at
* which the plaintext data, i.e. the LDAP message, begins.
*/
- tmp_length = tvb_captured_length_remaining(sasl_tvb, 4);
+ tmp_length = tvb_length_remaining(sasl_tvb, 4);
if ((guint)tmp_length > sasl_len)
tmp_length = sasl_len;
gssapi_tvb = tvb_new_subset(sasl_tvb, 4, tmp_length, sasl_len);
@@ -1443,7 +1443,7 @@ static void dissect_NetLogon_PDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
/* Get the length of the buffer */
- len=tvb_captured_length_remaining(tvb,offset);
+ len=tvb_length_remaining(tvb,offset);
/* check the len if it is to small return */
if (len < 10) return;
@@ -1462,7 +1462,7 @@ static void dissect_NetLogon_PDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
switch(itype){
case LOGON_SAM_LOGON_RESPONSE:
- bc = tvb_captured_length_remaining(tvb, offset);
+ bc = tvb_length_remaining(tvb, offset);
/* logon server name */
fn = get_unicode_or_ascii_string(tvb,&offset,TRUE,&fn_len,FALSE,FALSE,&bc);
proto_tree_add_string(tree, hf_mscldap_nb_hostname, tvb,offset, fn_len, fn);
@@ -1642,7 +1642,7 @@ static int
dissect_sasl_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_ldap_pdu(tvb, pinfo, tree, FALSE);
- return tvb_captured_length(tvb);
+ return tvb_length(tvb);
}
static guint
@@ -1664,7 +1664,7 @@ static int
dissect_normal_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_ldap_pdu(tvb, pinfo, tree, FALSE);
- return tvb_captured_length(tvb);
+ return tvb_length(tvb);
}
static void
@@ -1678,7 +1678,7 @@ dissect_ldap_oid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
* proto_tree_add_oid() instead.
*/
- oid=tvb_get_string_enc(wmem_packet_scope(), tvb, 0, tvb_captured_length(tvb), ENC_UTF_8|ENC_NA);
+ oid=tvb_get_string_enc(wmem_packet_scope(), tvb, 0, tvb_length(tvb), ENC_UTF_8|ENC_NA);
if(!oid){
return;
}
@@ -1686,9 +1686,9 @@ dissect_ldap_oid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
oidname=oid_resolved_from_string(oid);
if(oidname){
- proto_tree_add_text(tree, tvb, 0, tvb_captured_length(tvb), "OID: %s (%s)",oid,oidname);
+ proto_tree_add_text(tree, tvb, 0, tvb_length(tvb), "OID: %s (%s)",oid,oidname);
} else {
- proto_tree_add_text(tree, tvb, 0, tvb_captured_length(tvb), "OID: %s",oid);
+ proto_tree_add_text(tree, tvb, 0, tvb_length(tvb), "OID: %s",oid);
}
}
@@ -1770,7 +1770,7 @@ struct access_mask_info ldap_access_mask_info = {
static void
dissect_ldap_nt_sec_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- dissect_nt_sec_desc(tvb, 0, pinfo, tree, NULL, TRUE, tvb_captured_length(tvb), &ldap_access_mask_info);
+ dissect_nt_sec_desc(tvb, 0, pinfo, tree, NULL, TRUE, tvb_length(tvb), &ldap_access_mask_info);
}
static void
@@ -1856,7 +1856,7 @@ dissect_ldap_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 4, get_sasl_ldap_pdu_len, dissect_sasl_ldap_pdu, data);
- return tvb_captured_length(tvb);
+ return tvb_length(tvb);
this_was_not_sasl:
/* check if it is a normal BER encoded LDAP packet
@@ -1936,16 +1936,16 @@ this_was_not_normal_ldap:
dissector_add_uint("tcp.port", tcp_port, ldap_handle);
/* we are done */
- return tvb_captured_length(tvb);
+ return tvb_length(tvb);
}
/* Ok it might be a strange case of SASL still
* It has been seen with Exchange setup to MS AD
* when Exchange pretend that there is SASL but in fact data are still
* in clear*/
- if ((sasl_len + 4) == (guint32)tvb_captured_length_remaining(tvb, 0))
+ if ((sasl_len + 4) == (guint32)tvb_length_remaining(tvb, 0))
tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 4, get_sasl_ldap_pdu_len, dissect_sasl_ldap_pdu, data);
end:
- return tvb_captured_length(tvb);
+ return tvb_length(tvb);
}
static void