3 * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
6 /* ava.c - routines for dealing with attribute value assertions */
12 #include <ac/string.h>
13 #include <ac/socket.h>
20 AttributeAssertion *ava,
24 free( ava->aa_value.bv_val );
26 ch_free( (char *) ava );
33 AttributeAssertion **ava,
40 struct berval type, value;
41 AttributeAssertion *aa;
43 rtag = ber_scanf( ber, "{mm}", &type, &value );
45 if( rtag == LBER_ERROR ) {
47 LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
48 "get_ava: ber_scanf failure\n" ));
50 Debug( LDAP_DEBUG_ANY, " get_ava ber_scanf\n", 0, 0, 0 );
52 *text = "Error decoding attribute value assertion";
53 return SLAPD_DISCONNECT;
56 aa = ch_malloc( sizeof( AttributeAssertion ) );
58 aa->aa_value.bv_val = NULL;
60 rc = slap_bv2ad( &type, &aa->aa_desc, text );
62 if( rc != LDAP_SUCCESS ) {
67 rc = value_validate_normalize( aa->aa_desc, usage,
68 &value, &aa->aa_value, text );
70 if( rc != LDAP_SUCCESS ) {