Wireshark-dev: [Wireshark-dev] Problems with asn2wrs -X option for LDAP

From: "Anders Broman" <a.broman@xxxxxxxxx>
Date: Tue, 29 May 2007 21:19:46 +0200

Hi,

Without the –X option this code snippet looks like:

 

 

static int dissect_vals_item(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {

  return dissect_ldap_AttributeValue(FALSE, tvb, offset, actx, tree, hf_ldap_vals_item);

}

 

 

static const ber_old_sequence_t SET_OF_AttributeValue_set_of[1] = {

  { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_vals_item },

};

 

static int

dissect_ldap_SET_OF_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {

  offset = dissect_ber_old_set_of(implicit_tag, actx, tree, tvb, offset,

                                     SET_OF_AttributeValue_set_of, hf_index, ett_ldap_SET_OF_AttributeValue);

 

  return offset;

}

 

Withe the –X option:

static const ber_sequence_t SET_OF_AttributeValue_set_of[1] = {

  { &hf_ldap_vals_item      , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeValue },

};

 

static int

dissect_ldap_SET_OF_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {

  offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,

                                 SET_OF_AttributeValue_set_of, hf_index, ett_ldap_SET_OF_AttributeValue);

 

  return offset;

}

 

Shouldn’t BER_FLAGS_IMPLTAG have been added to:

  { &hf_ldap_vals_item      , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ldap_AttributeValue },

 

Regards

Anders