]> git.sur5r.net Git - openldap/blob - doc/man/man3/ldap_parse_result.3
9664a09afd68f60da94b80477ff781da0498a1ac
[openldap] / doc / man / man3 / ldap_parse_result.3
1 .TH LDAP_PARSE_RESULT 3 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2002 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .SH NAME
6 ldap_parse_result \- Parsing results
7 .SH LIBRARY
8 OpenlDAP LDAP (libldap, -lldap)
9 .SH SYNOPSIS
10 .nf
11 .ft B
12 #include <ldap.h>
13 .LP
14 .ft B
15 int ldap_parse_result( LDAP *ld, LDAPMessage *result,
16         int *errcodep, char **matcheddnp, char **errmsgp,
17         char ***referralsp, LDAPControl ***serverctrlsp, int freeit )
18 .LP
19 .ft B
20 int ldap_parse_sasl_bind_result( LDAP *ld, LDAPMessage *result,
21         struct berval **servercredp, int freeit )
22 .LP
23 .ft B
24 int ldap_parse_extended_result( LDAP *ld, LDAPMessage *result,
25         char **retoidp, struct berval **retdatap, int freeit )
26 .SH DESCRIPTION
27 .LP
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
32 .BR ldap_result (3),
33 .BR ldap_search_s (3)
34 or
35 .BR ldap_search_st (3).
36 In addition to
37 .BR ldap_parse_result() ,
38 the routines
39 .B ldap_parse_sasl_bind_result()
40 and
41 .B ldap_parse_extended_result()
42 are used to get all the result information from SASL bind and extended
43 operations.
44 .LP
45 The \fIerrcodep\fP parameter will be filled in with the result code from
46 the result message.
47 .LP
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
52 .BR ldap_memfree (3).
53 .LP
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
56 .BR ldap_memfree (3).
57 .LP
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.
62 .LP
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.
67 .LP
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
70 free the message. The
71 .BR ldap_msgfree (3)
72 routine can also be used to free the message later.
73 .LP
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
77 .BR ber_bvfree (3).
78 .LP
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
82 .BR ldap_memfree (3).
83 If no OID was returned, \fI*retoidp\fP is set to NULL.
84 .LP
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
88 .BR ber_bvfree (3).
89 If no data were returned, \fI*retdatap\fP is set to NULL.
90 .LP
91 For all the above result parameters, NULL values can be used in calls
92 in order to ignore certain fields.
93 .SH ERRORS
94 Upon success LDAP_SUCCESS is returned. Otherwise the values of the
95 result parameters are undefined.
96 .SH SEE ALSO
97 .BR ldap (3),
98 .BR ldap_result (3),
99 .BR ldap_search (3),
100 .BR ldap_memfree (3),
101 .BR ldap_get_values (3),
102 .BR ldap_controls_free (3),
103 .BR lber-types (3)
104 .SH ACKNOWLEDGEMENTS
105 .B      OpenLDAP
106 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
107 .B      OpenLDAP
108 is derived from University of Michigan LDAP 3.3 Release.