1 .TH LDAP_PARSE_RESULT 3 "RELEASEDATE" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2002 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldap_parse_result \- Parsing results
8 OpenlDAP LDAP (libldap, -lldap)
15 int ldap_parse_result( LDAP *ld, LDAPMessage *result,
16 int *errcodep, char **matcheddnp, char **errmsgp,
17 char ***referralsp, LDAPControl ***serverctrlsp, int freeit )
20 int ldap_parse_sasl_bind_result( LDAP *ld, LDAPMessage *result,
21 struct berval **servercredp, int freeit )
24 int ldap_parse_extended_result( LDAP *ld, LDAPMessage *result,
25 char **retoidp, struct berval **retdatap, int freeit )
28 These routines are used to extract information from a result message.
29 They will operate on the first result message in a chain of search
30 results (skipping past other message types). They take the \fIresult\fP
31 as returned by a call to
35 .BR ldap_search_st (3).
37 .BR ldap_parse_result() ,
39 .B ldap_parse_sasl_bind_result()
41 .B ldap_parse_extended_result()
42 are used to get all the result information from SASL bind and extended
45 The \fIerrcodep\fP parameter will be filled in with the result code from
48 The server might supply a matched DN string in the message indicating
49 how much of a name in a request was recognized. The \fImatcheddnp\fP
50 parameter will be filled in with this string if supplied, else it will
51 be NULL. If a string is returned, it should be freed using
54 The \fIerrmsgp\fP parameter will be filled in with the error message
55 field from the parsed message. This string should be freed using
58 The \fIreferralsp\fP parameter will be filled in with an allocated array of
59 referral strings from the parsed message. This array should be freed using
60 .BR ldap_value_free (3).
61 If no referrals were returned, \fI*referralsp\fP is set to NULL.
63 The \fIserverctrlsp\fP parameter will be filled in with an allocated array of
64 controls copied from the parsed message. The array should be freed using
65 .BR ldap_controls_free (3).
66 If no controls were returned, \fI*serverctrlsp\fP is set to NULL.
68 The \fIfreeit\fP parameter determines whether the parsed message is
69 freed or not after the extraction. Any non-zero value will make it
72 routine can also be used to free the message later.
74 For SASL bind results, the \fIservercredp\fP parameter will be filled in
75 with an allocated berval structure containing the credentials from the
76 server if present. The structure should be freed using
79 For extended results, the \fIretoidp\fP parameter will be filled in
80 with the dotted-OID text representation of the name of the extended
81 operation response. The string should be freed using
83 If no OID was returned, \fI*retoidp\fP is set to NULL.
85 For extended results, the \fIretdatap\fP parameter will be filled in
86 with a pointer to a berval structure containing the data from the
87 extended operation response. The structure should be freed using
89 If no data were returned, \fI*retdatap\fP is set to NULL.
91 For all the above result parameters, NULL values can be used in calls
92 in order to ignore certain fields.
94 Upon success LDAP_SUCCESS is returned. Otherwise the values of the
95 result parameters are undefined.
100 .BR ldap_memfree (3),
101 .BR ldap_get_values (3),
102 .BR ldap_controls_free (3),
106 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
108 is derived from University of Michigan LDAP 3.3 Release.