]> git.sur5r.net Git - openldap/blob - doc/man/man3/ldap_parse_result.3
24506b0ae96dc2a63af207709ddd17b92a127538
[openldap] / doc / man / man3 / ldap_parse_result.3
1 .TH LDAP_PARSE_RESULT 3 "10 October 2001" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2001 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .SH NAME
6 ldap_parse_result \- Parsing results
7 .SH SYNOPSIS
8 .nf
9 .ft B
10 #include <ldap.h>
11 .LP
12 .ft B
13 int ldap_parse_result( LDAP *ld, LDAPMessage *result,
14         int *errcodep, char **matcheddnp, char **errmsgp,
15         char ***referralsp, LDAPControl ***serverctrlsp, int freeit )
16 .LP
17 .ft B
18 int ldap_parse_sasl_bind_result( LDAP *ld, LDAPMessage *result,
19         struct berval **servercredp, int freeit )
20 .LP
21 .ft B
22 int ldap_parse_extended_result( LDAP *ld, LDAPMessage *result,
23         char **retoidp, struct berval **retdatap, int freeit )
24 .SH DESCRIPTION
25 .LP
26 These routines are used to extract information from a result message.
27 They will operate on the first result message in a chain of search
28 results (skipping past other message types). They take the \fIresult\fP
29 as returned by a call to
30 .BR ldap_result (3) ,
31 .BR ldap_search_s (3)
32 or
33 .BR ldap_search_st (3) .
34 In addition to
35 .B ldap_parse_result() ,
36 the routines
37 .B ldap_parse_sasl_bind_result()
38 and
39 .B ldap_parse_extended_result()
40 are used to get all the result information from SASL bind and extended
41 operations.
42 .LP
43 The \fIerrcodep\fP parameter will be filled in with the result code from
44 the result message.
45 .LP
46 The server might supply a matched DN string in the message indicating
47 how much of a name in a request was recognized. The \fImatcheddnp\fP
48 parameter will be filled in with this string if supplied, else it will
49 be NULL. If a string is returned, it should be freed using
50 .BR ldap_memfree(3) .
51 .LP
52 The \fIerrmsgp\fP parameter will be filled in with the error message
53 field from the parsed message. This string should be freed using
54 .BR ldap_memfree(3) .
55 .LP
56 The \fIreferralsp\fP parameter will be filled in with an allocated array of
57 referral strings from the parsed message. This array should be freed using
58 .BR ldap_value_free(3) .
59 If no referrals were returned, \fI*referralsp\fP is set to NULL.
60 .LP
61 The \fIserverctrlsp\fP parameter will be filled in with an allocated array of
62 controls copied from the parsed message. The array should be freed using
63 .BR ldap_controls_free(3) .
64 If no controls were returned, \fI*serverctrlsp\fP is set to NULL.
65 .LP
66 The \fIfreeit\fP parameter determines whether the parsed message is
67 freed or not after the extraction. Any non-zero value will make it
68 free the message. The
69 .BR ldap_msgfree(3)
70 routine can also be used to free the message later.
71 .LP
72 For SASL bind results, the \fIservercredp\fP parameter will be filled in
73 with an allocated berval structure containing the credentials from the
74 server if present. The structure should be freed using
75 .BR ber_bvfree(3) .
76 .LP
77 For extended results, the \fIretoidp\fP parameter will be filled in
78 with the dotted-OID text representation of the name of the extended
79 operation response. The string should be freed using
80 .BR ldap_memfree(3) .
81 If no OID was returned, \fI*retoidp\fP is set to NULL.
82 .LP
83 For extended results, the \fIretdatap\fP parameter will be filled in
84 with a pointer to a berval structure containing the data from the
85 extended operation response. The structure should be freed using
86 .BR ber_bvfree(3) .
87 If no data were returned, \fI*retdatap\fP is set to NULL.
88 .LP
89 For all the above result parameters, NULL values can be used in calls
90 in order to ignore certain fields.
91 .SH ERRORS
92 Upon success LDAP_SUCCESS is returned. Otherwise the values of the
93 result parameters are undefined.
94 .SH SEE ALSO
95 .BR ldap (3)
96 .BR ldap_result (3)
97 .BR ldap_search (3)
98 .BR ldap_memfree (3)
99 .BR ldap_get_values (3)
100 .BR ldap_controls_free (3)
101 .BR lber-types (3)
102 .SH ACKNOWLEDGEMENTS
103 .B      OpenLDAP
104 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
105 .B      OpenLDAP
106 is derived from University of Michigan LDAP 3.3 Release.