3 * Copyright 1998-2000 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 ber_bvfree( ava->aa_value );
26 ch_free( (char *) ava );
33 AttributeAssertion **ava,
39 struct berval type, value, *nvalue;
40 AttributeAssertion *aa;
42 rc = ber_scanf( ber, "{oo}", &type, &value );
44 if( rc == LBER_ERROR ) {
46 LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
47 "get_ava: ber_scanf failure\n" ));
49 Debug( LDAP_DEBUG_ANY, " get_ava ber_scanf\n", 0, 0, 0 );
51 *text = "Error decoding attribute value assertion";
52 return SLAPD_DISCONNECT;
55 aa = ch_malloc( sizeof( AttributeAssertion ) );
59 rc = slap_bv2ad( &type, &aa->aa_desc, text );
60 ch_free( type.bv_val );
62 if( rc != LDAP_SUCCESS ) {
63 ch_free( value.bv_val );
68 rc = value_normalize( aa->aa_desc, usage, &value, &nvalue, text );
69 ch_free( value.bv_val );
71 if( rc != LDAP_SUCCESS ) {
76 aa->aa_value = nvalue;