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