2 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
6 * Copyright (c) 1990 Regents of the University of Michigan.
18 #include <ac/socket.h>
19 #include <ac/string.h>
25 ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **ber )
30 assert( entry != NULL );
31 assert( ber != NULL );
33 Debug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 );
35 if ( (*ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) {
40 **ber = *entry->lm_ber;
43 * Skip past the sequence, dn, sequence of sequence, snarf the
44 * attribute type, and skip the set of values, leaving us
45 * positioned right before the next attribute type/value sequence.
48 if ( ber_scanf( *ber, "{x{{ax}", &attr )
50 ld->ld_errno = LDAP_DECODING_ERROR;
61 ldap_next_attribute( LDAP *ld, LDAPMessage *entry, BerElement *ber )
66 assert( entry != NULL );
67 assert( ber != NULL );
69 Debug( LDAP_DEBUG_TRACE, "ldap_next_attribute\n", 0, 0, 0 );
71 /* skip sequence, snarf attribute type, skip values */
72 if ( ber_scanf( ber, "{ax}", &attr )
74 ld->ld_errno = LDAP_DECODING_ERROR;