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>
17 #ifdef SLAPD_SCHEMA_NOT_COMPAT
21 AttributeAssertion *ava,
25 ad_free( ava->aa_desc, 1 );
26 ber_bvfree( ava->aa_value );
28 ch_free( (char *) ava );
35 AttributeAssertion **ava,
40 struct berval type, *value;
41 AttributeAssertion *aa;
43 rc = ber_scanf( ber, "{oO}", &type, &value );
45 if( rc == LBER_ERROR ) {
46 Debug( LDAP_DEBUG_ANY, " get_ava ber_scanf\n", 0, 0, 0 );
47 *text = "Error decoding attribute value assertion";
48 return SLAPD_DISCONNECT;
51 aa = ch_malloc( sizeof( AttributeAssertion ) );
54 rc = slap_bv2ad( &type, &aa->aa_desc, text );
56 if( rc != LDAP_SUCCESS ) {
57 ch_free( type.bv_val );
77 ch_free( (char *) ava->ava_type );
78 ch_free( (char *) ava->ava_value.bv_val );
80 ch_free( (char *) ava );
91 if ( ber_scanf( ber, "{ao}", &ava->ava_type, &ava->ava_value )
93 Debug( LDAP_DEBUG_ANY, " get_ava ber_scanf\n", 0, 0, 0 );
94 *text = "Error decoding attribute value assertion";
95 return SLAPD_DISCONNECT;
98 attr_normalize( ava->ava_type );
99 value_normalize( ava->ava_value.bv_val, attr_syntax( ava->ava_type ) );