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 return SLAPD_DISCONNECT;
50 aa = ch_malloc( sizeof( AttributeAssertion ) );
52 rc = slap_bv2ad( &type, &aa->aa_desc, &text );
54 if( rc != LDAP_SUCCESS ) {
55 ch_free( type.bv_val );
74 ch_free( (char *) ava->ava_type );
75 ch_free( (char *) ava->ava_value.bv_val );
77 ch_free( (char *) ava );
87 if ( ber_scanf( ber, "{ao}", &ava->ava_type, &ava->ava_value )
89 Debug( LDAP_DEBUG_ANY, " get_ava ber_scanf\n", 0, 0, 0 );
90 return SLAPD_DISCONNECT;
93 attr_normalize( ava->ava_type );
94 value_normalize( ava->ava_value.bv_val, attr_syntax( ava->ava_type ) );