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 ad_free( ava->aa_desc, 1 );
25 ber_bvfree( ava->aa_value );
27 ch_free( (char *) ava );
34 AttributeAssertion **ava,
40 struct berval type, value, *nvalue;
41 AttributeAssertion *aa;
43 rc = ber_scanf( ber, "{oo}", &type, &value );
45 if( rc == 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 ) );
60 rc = slap_bv2ad( &type, &aa->aa_desc, text );
61 ch_free( type.bv_val );
63 if( rc != LDAP_SUCCESS ) {
64 ch_free( value.bv_val );
69 rc = value_normalize( aa->aa_desc, usage, &value, &nvalue, text );
70 ch_free( value.bv_val );
72 if( rc != LDAP_SUCCESS ) {
73 ad_free( aa->aa_desc, 1 );
78 aa->aa_value = nvalue;