231 lines
7.0 KiB
HTML
231 lines
7.0 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
|
|
<title>ldap_parse_result()--Extract Information from Results</title>
|
|
<!-- Begin Header Records ========================================== -->
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<!-- Change History: -->
|
|
<!-- YYMMDD USERID Change description -->
|
|
<!-- Direct1 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
|
|
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
|
|
<!-- File Edited April 2001 -->
|
|
<!-- This file has undergone html cleanup on 2/19/02 by JET -->
|
|
<!--End Header Records -->
|
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
|
</head>
|
|
<body>
|
|
<!-- Java sync-link -->
|
|
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
|
|
</script>
|
|
|
|
<a name="Top_Of_Page"></a>
|
|
|
|
<h2>ldap_parse_result()--Extract Information from Results</h2>
|
|
|
|
<br>
|
|
<div class="box" style="width: 70%;">
|
|
<br>
|
|
Syntax<br>
|
|
<pre>
|
|
#include <ldap.h>
|
|
|
|
int ldap_parse_result(
|
|
LDAP *<em>ld</em>,
|
|
LDAPMessage *<em>res</em>,
|
|
int *<em>errcodep</em>,
|
|
char **<em>matcheddnp</em>,
|
|
char **<em>errmsgp</em>,
|
|
char ***<em>referralsp</em>,
|
|
LDAPControl ***<em>servctrlsp</em>,
|
|
int <em>freeit</em>)
|
|
</pre>
|
|
|
|
<br>
|
|
Default Public Authority: *USE<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
Library Name/Service Program: QSYS/QGLDCLNT<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
Threadsafe: Yes<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
</div>
|
|
|
|
<p>The <strong>ldap_parse_result()</strong> routine is used to:</p>
|
|
|
|
<ul>
|
|
<li>Obtain the LDAP error code field associated with an LDAPMessage <em>
|
|
res</em>.</li>
|
|
|
|
<li>Obtain the portion of the DN that the server recognizes for a failed
|
|
operation.</li>
|
|
|
|
<li>Obtain the text error message associated with the error code returned in an
|
|
LDAPMessage <em>res</em>.</li>
|
|
|
|
<li>Obtain the list of alternate servers from the referrals field.</li>
|
|
|
|
<li>Obtain the array of controls that may be returned by the server.</li>
|
|
</ul>
|
|
|
|
<br>
|
|
<h3>Authorities and Locks</h3>
|
|
|
|
<p>No i5/OS authority is required.</p>
|
|
|
|
<br>
|
|
<h3>Parameters</h3>
|
|
|
|
<dl>
|
|
<dt><em>ld</em></dt>
|
|
|
|
<dd>(Input) Specifies the LDAP pointer returned by a previous call to <a href=
|
|
"ldap_init.htm">ldap_init()</a>, <a href="ldap_ssl_init.htm">
|
|
ldap_ssl_init()</a>, or <a href="ldap_open.htm">ldap_open()</a>.</dd>
|
|
|
|
<dt><em>res</em></dt>
|
|
|
|
<dd>(Input) Specifies the result of an LDAP operation as returned by <a href=
|
|
"ldap_result.htm">ldap_result()</a> or one of the synchronous LDAP API
|
|
operation calls.</dd>
|
|
|
|
<dt><em>errcodep</em></dt>
|
|
|
|
<dd>(Output) Specifies a pointer to the result parameter that will be filled in
|
|
with the LDAP error code field from the LDAPMessage <em>res</em>. The
|
|
LDAPResult message is produced by the LDAP server, and indicates the outcome of
|
|
the operation. NULL can be specified for <em>errcodep</em> if the error code is
|
|
to be ignored.</dd>
|
|
|
|
<dt><em>matcheddnp</em></dt>
|
|
|
|
<dd>(Output) Specifies a pointer to a result parameter. When
|
|
LDAP_NO_SUCH_OBJECT is returned as the LDAP error code, this result parameter
|
|
will be filled in with a Distinguished Name indicating how much of the name in
|
|
the request was recognized by the server. NULL can be specified for <em>
|
|
matcheddnp</em> if the matched DN is to be ignored. The matched DN string
|
|
should be freed by calling <a href="ldap_memfree.htm">ldap_memfree()</a>.</dd>
|
|
|
|
<dt><em>errmsgp</em></dt>
|
|
|
|
<dd>(Output) Specifies a pointer to a result parameter that is filled in with
|
|
the contents of the error message from the LDAPMessage <em>res</em>. The error
|
|
message string should be freed by calling <a href="ldap_memfree.htm">
|
|
ldap_memfree()</a>.</dd>
|
|
|
|
<dt><em>referralsp</em></dt>
|
|
|
|
<dd>(Output) Specifies a pointer to a result parameter that is filled in with
|
|
the contents of the referrals field from the LDAPMessage <em>res</em>,
|
|
indicating zero or more alternate LDAP servers where the request should be
|
|
retried. The referrals array should be freed by calling <a href=
|
|
"ldap_value_free.htm">ldap_value_free()</a>. NULL may be supplied for this
|
|
parameter to ignore the referrals field.</dd>
|
|
|
|
<dt><em>serverctrlsp</em></dt>
|
|
|
|
<dd>(Ourput) Specifies a pointer to a result parameter that is filled in with
|
|
an allocated array of controls copied out of the LDAPMessage <em>res</em>. The
|
|
control array should be freed by calling <a href="ldap_cntrls_free.htm">
|
|
ldap_controls_free()</a>.</dd>
|
|
|
|
<dt><em>freeit</em></dt>
|
|
|
|
<dd>(Input) Specifies a boolean value that determines if the LDAP result chain
|
|
(as specified by <em>res</em>) is to be freed. Any non-zero value will result
|
|
in the LDAP result chain being freed after the requested information is
|
|
extracted. Alternatively, the <a href="ldap_msgfree.htm">ldap_msgfree()</a> API
|
|
can be used to free the LDAP result chain at a later time.</dd>
|
|
</dl>
|
|
|
|
<br>
|
|
|
|
|
|
<h3>Return Value</h3>
|
|
|
|
<dl>
|
|
<dt><strong>LDAP_SUCCESS</strong></dt>
|
|
|
|
<dd>if the result was successfully located and parsed.<br>
|
|
<br>
|
|
</dd>
|
|
|
|
<dt><strong>another LDAP error code</strong></dt>
|
|
|
|
<dd>if not successfully parsed.</dd>
|
|
</dl>
|
|
|
|
<br>
|
|
|
|
|
|
<h3>Error Conditions</h3>
|
|
|
|
<p>The <strong>ldap_parse_result()</strong> function will return an LDAP error
|
|
code if not successful. See <a href="ldap_error_condt.htm">LDAP Client API
|
|
Error Conditions</a> for possible LDAP error code values.</p>
|
|
|
|
<br>
|
|
|
|
|
|
<h3>Error Messages</h3>
|
|
|
|
<p>The following message may be sent from this function.</p>
|
|
|
|
<table width="100%" cellpadding="3">
|
|
<tr>
|
|
<th align="left" valign="top">Message ID</th>
|
|
<th align="left" valign="top">Error Message Text</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td width="15%" valign="top">CPF3CF2 E</td>
|
|
<td width="85%" valign="top">Error(s) occurred during running of
|
|
ldap_parse_result API.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
<br>
|
|
|
|
|
|
<h3>Related Information</h3>
|
|
|
|
<ul>
|
|
<li><a href="ldap_first_msg.htm">ldap_first_message()</a> -- Retrieve first
|
|
LDAP message.</li>
|
|
|
|
<li><a href="ldap_next_msg.htm">ldap_next_message()</a> -- Retrieve next LDAP
|
|
message.</li>
|
|
|
|
<li><a href="ldap_parse_extended_result.htm">ldap_parse_extended_result()</a>
|
|
-- Parse extended result.</li>
|
|
|
|
<li><a href="ldap_parse_sasl_bind_result.htm">ldap_parse_sasl_bind_result()</a>
|
|
-- Extract server credentials from SASL bind results.</li>
|
|
|
|
<li><a href="ldap_result.htm">ldap_result()</a> -- Retrieve result of an
|
|
asynchronous LDAP operation.</li>
|
|
</ul>
|
|
|
|
<br>
|
|
<hr>
|
|
API introduced: V4R5
|
|
|
|
<hr>
|
|
<table align="center" cellpadding="2" cellspacing="2">
|
|
<tr align="center">
|
|
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
|
|
"dirserv1.htm">LDAP APIs</a> | <a href="aplist.htm">APIs by
|
|
category</a></td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>
|
|
|