LDAP Library Functions ldapgetoption(3LDAP)
NAME
ldapgetoption, ldapsetoption - get or set session
preferences in the ldap structure.
SYNOPSIS
cc [ flag... ] file... -lldap [ library... ]
#include
#include
LDAP ldapsetoption(LDAP *ld, int option, void *optdata[]);
LDAP ldapgetoption(LDAP *ld, int option, void optdata[]);
DESCRIPTION
These functions provide an LDAP structure with access to
session preferences. The ldapgetoption() function gets
session preferences from the LDAP structure. The
ldapsetoption() function sets session preferences in the
LDAP structure.
The ld parameter specifies the connection handle, a pointer
to an LDAP structure that contains information about the
LDAP server connection. The option parameter specifies the
name of the option to be read or modified. The optdata
parameter serves as a pointer to the value of the option
that you set or get.
PARAMETERS
The following values can be specified for the option parame-
ter:
LDAPOPTAPINFO
Retrieves basic information about the LDAP API implemen-
tation at execution time. The data type for the optdata
parameter is (LDAPAPInfo *). This option is READ-ONLY
and cannot be set.
LDAPOPTDEREF
Determines how aliases are handled during a search. The
data type for the optdata parameter is (int *). The fol-
lowing values can be specified for the optdata parame-
ter:
LDAPDEREFNEVER Specifies that aliases are never
dereferenced.
SunOS 5.11 Last change: 15 Jan 2004 1
LDAP Library Functions ldapgetoption(3LDAP)
LDAPDEREFSEARCHING Specifies that aliases are
dereferenced when searching
under the base object, but not
when finding the base object.
LDAPDEREFINDING Specifies that aliases are
dereferenced when finding the
base object, but not when
searching under the base object.
LDAPDEREFALWAYS Specifies that aliases are
always dereferenced when finding
the base object and searching
under the base object.
LDAPOPTSIZELIMIT
Specifies the maximum number of entries returned by the
server in search results. The data type for the optdata
parameter is (int *). Setting the optdata parameter to
LDAPNOLIMIT removes any size limit enforced by the
client.
LDAPOPTIMELIMIT
Specifies the maximum number of seconds spent by the
server when answering a search request. The data type
for the optdata parameter is (int *). Setting the opt-
data parameter to LDAPNOLIMIT removes any time limit
enforced by the client.
LDAPOPTREFERALS
Determines whether the client should follow referrals.
The data type for the optdata parameter is (int *). The
following values can be specified for the optdata param-
eter:
LDAPOPTON Specifies that the client should follow
referrals.
LDAPOPTOF Specifies that the client should not
follow referrals.
By default, the client follows referrals.
SunOS 5.11 Last change: 15 Jan 2004 2
LDAP Library Functions ldapgetoption(3LDAP)
LDAPOPTRESTART
Determines whether LDAP I/O operations are automatically
restarted if aborted prematurely. It can be set to one
of the constants LDAPOPTON or LDAPOPTOF.
LDAPOPTPROTOCOLVERSION
Specifies the version of the protocol supported by the
client. The data type for the optdata parameter is (int
*). The version LDAPVERSION2 or LDAPVERSION3 can be
specified. If no version is set, the default version
LDAPVERSION2 is set. To use LDAP v3 features, set the
protocol version to LDAPVERSION3.
LDAPOPTSERVERCONTROLS
Specifies a pointer to an array of LDAPControl struc-
tures that represent the LDAP v3 server controls sent by
default with every request. The data type for the opt-
data parameter for ldapsetoption() is (LDAPControl
**). For ldapgetoption(), the data type is (LDAPCon-
trol ***).
LDAPOPTCLIENTCONTROLS
Specifies a pointer to an array of LDAPControl struc-
tures that represent the LDAP v3 client controls sent by
default with every request. The data type for the opt-
data parameter for ldapsetoption() is (LDAPControl
**). For ldapgetoption(), the data type is (LDAPCon-
trol ***).
LDAPOPTAPIFEATUREINFO
Retrieves version information at execution time about
extended features of the LDAP API. The data type for the
optdata parameter is (LDAPAPIFeatureInfo *). This option
is READ-ONLY and cannot be set.
LDAPOPTHOSTNAME
Sets the host name or a list of hosts for the primary
LDAP server. The data type for the optdata parameter for
ldapsetoption() is (char *). For ldapgetoption(),
the data type is (char **).
SunOS 5.11 Last change: 15 Jan 2004 3
LDAP Library Functions ldapgetoption(3LDAP)
LDAPOPTERORNUMBER
Specifies the code of the most recent LDAP error that
occurred for this session. The data type for the optdata
parameter is (int *).
LDAPOPTERORSTRING
Specifies the message returned with the most recent LDAP
error that occurred for this session. The data type for
the optdata parameter for ldapsetoption() is (char *)
and for ldapgetoption() is (char **).
LDAPOPTMATCHEDN
Specifies the matched DN value returned with the most
recent LDAP error that occurred for this session. The
data type for the optdata parameter for
ldapsetoption() is (char *) and for ldapgetoption()
is (char **).
LDAPOPTREBINDARG
Sets the last argument passed to the routine specified
by LDAPOPTREBINDFN. This option can also be set by
calling the ldapsetrebindproc() function. The data
type for the optdata parameter is (void * ).
LDAPOPTREBINDFN
Sets the routine to be called to authenticate a connec-
tion with another LDAP server. For example, the option
is used to set the routine called during the course of a
referral. This option can also be by calling the
ldapsetrebindproc() function. The data type for the
optdata parameter is (LDAPREBINDPROCALBACK *).
LDAPOPTXSASLMECH
Sets the default SASL mechanism to call
ldapinteractivebinds(). The data type for the optdata
parameter is (char * ).
LDAPOPTXSASLREALM
Sets the default SASLREALM. The default SASLREALM
SunOS 5.11 Last change: 15 Jan 2004 4
LDAP Library Functions ldapgetoption(3LDAP)
should be used during a SASL challenge in response to a
SASLCBGETREALM request when using the
ldapinteractivebinds() function. The data type for
the optdata parameter is (char * ).
LDAPOPTXSASLAUTHCID
Sets the default SASLAUTHNAME used during a SASL chal-
lenge in response to a SASLCBAUTHNAME request when
using the ldapinteractivebinds() function. The data
type for the optdata parameter is (char * ).
LDAPOPTXSASLAUTHZID
Sets the default SASLUSER that should be used during a
SASL challenge in response to a SASLCBUSER request
when using the ldapinteractivebinds function. The
data type for the optdata parameter is (char * ).
LDAPOPTXSASLSF
A read-only option used exclusively with the
ldapgetoption() function. The ldapgetoption() func-
tion performs a saslgetprop() operation that gets the
SASLSF value for the current connection. The data type
for the optdata parameter is (saslssft * ).
LDAPOPTXSASLSFEXTERNAL
A write-only option used exclusively with the
ldapsetoption() function. The ldapsetoption() func-
tion performs a saslsetprop() operation to set the
SASLSFEXTERNAL value for the current connection. The
data type for the optdata parameter is (saslssft * ).
LDAPOPTXSASLSECPROPS
A write-only option used exclusively with the
ldapsetoption(). This function performs a
saslsetprop(3SASL) operation for the SASLSECPROPS
value for the current connection during an
ldapinteractivebinds() operation. The data type for
the optdata parameter is (char * ), a comma delimited
string containing text values for any of the
SASLSECPROPS that should be set. The text values are:
SunOS 5.11 Last change: 15 Jan 2004 5
LDAP Library Functions ldapgetoption(3LDAP)
noanonymous Sets the SASLSECNOANONYMOUS flag
nodict Sets the SASLSECNODICTIONARY flag
noplain Sets the SASLSECNOPLAINTEXT flag
forwardsec Sets the SASLSECFORWARDSECRECY flag
passcred Sets the SASLSECPASCREDENTIALS flag
minssf=N Sets minssf to the integer value N
maxssf=N Sets maxssf to the integer value N
maxbufsize=N Sets maxbufsize to the integer value N
LDAPOPTXSASLSFMIN
Sets the default SFMIN value used during a
ldapinteractivebinds() operation. The data type for
the optdata parameter is (char * ) numeric string.
LDAPOPTXSASLSFMAX
Sets the default SFMAX value used during a
ldapinteractivebinds() operation. The data type for
the optdata parameter is (char * ) numeric string.
LDAPOPTXSASLMAXBUFSIZE
Sets the default SFMAXBUFSIZE value used during a
ldapinteractivebinds() operation. The data type for
the optdata parameter is (char * ) numeric string.
RETURN VALUES
The ldapsetoption() and ldapgetoption() functions
return:
LDAPSUCES If successful
SunOS 5.11 Last change: 15 Jan 2004 6
LDAP Library Functions ldapgetoption(3LDAP)
-1 If unsuccessful
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Evolving
MT-Level Safe
SEE ALSO
ldapinit(3LDAP), saslsetprop(3SASL), attributes(5)
NOTES
There are other elements in the LDAP structure that should
not be changed. No assumptions should be made about the
order of elements in the LDAP structure.
SunOS 5.11 Last change: 15 Jan 2004 7
|