1ldap_ufn(3LDAP) LDAP Library Functions ldap_ufn(3LDAP)
2
3
4
6 ldap_ufn, ldap_ufn_search_s, ldap_ufn_search_c, ldap_ufn_search_ct,
7 ldap_ufn_setfilter, ldap_ufn_setprefix, ldap_ufn_timeout - LDAP user
8 friendly search functions
9
11 cc[ flag... ] file... -lldap[ library... ]
12 #include <lber.h>
13 #include <ldap.h>
14
15 int ldap_ufn_search_c(LDAP *ld, char *ufn, char **attrs,
16 int attrsonly, LDAPMessage **res, int (*cancelproc)(),
17 void *cancelparm);
18
19
20 int ldap_ufn_search_ct(LDAP *ld, char *ufn, char **attrs,
21 int attrsonly, LDAPMessage **res,int (*cancelproc)(),
22 void *cancelparm,char *tag1, char *tag2,
23 char *tag3);
24
25
26 int ldap_ufn_search_s(LDAP *ld, char *ufn, char **attrs,
27 int attrsonly, LDAPMessage **res);
28
29
30 LDAPFiltDesc *ldap_ufn_setfilter(LDAP *ld, char *fname);
31
32
33 void ldap_ufn_setprefix(LDAP *ld, char *prefix);
34
35
36 int ldap_ufn_timeout(void *tvparam);
37
38
40 These functions are used to perform LDAP user friendly search opera‐
41 tions. ldap_ufn_search_s() is the simplest form. It does the search
42 synchronously. It takes ld to identify the the LDAP connection. The
43 ufn parameter is the user friendly name for which to search. The attrs,
44 attrsonly and res parameters are the same as for ldap_search(3LDAP).
45
46
47 The ldap_ufn_search_c() function functions the same as
48 ldap_ufn_search_s(), except that it takes cancelproc, a function to
49 call periodicly during the search. It should be a function taking a
50 single void * argument, given by calcelparm. If cancelproc returns a
51 non-zero result, the search will be abandoned and no results returned.
52 The purpose of this function is to provide a way for the search to be
53 cancelled, for example, by a user or because some other condition
54 occurs.
55
56
57 The ldap_ufn_search_ct() function is like ldap_ufn_search_c(), except
58 that it takes three extra parameters. tag1 is passed to the
59 ldap_init_getfilter(3LDAP) function when resolving the first component
60 of the UFN. tag2 is used when resolving intermediate components. tag3
61 is used when resolving the last component. By default, the tags used by
62 the other UFN search functions during these three phases of the search
63 are "ufn first", "ufn intermediate", and "ufn last".
64
65
66 The ldap_ufn_setfilter() function is used to set the ldapfilter.conf(4)
67 file for use with the ldap_init_getfilter(3LDAP) function to fname.
68
69
70 The ldap_ufn_setprefix() function is used to set the default prefix
71 (actually, it's a suffix) appended to UFNs before searhing. UFNs with
72 fewer than three components have the prefix appended first, before
73 searching. If that fails, the UFN is tried with progressively shorter
74 versions of the prefix, stripping off components. If the UFN has three
75 or more components, it is tried by itself first. If that fails, a sim‐
76 ilar process is applied with the prefix appended.
77
78
79 The ldap_ufn_timeout() function is used to set the timeout associated
80 with ldap_ufn_search_s() searches. The timeout parameter should actu‐
81 ally be a pointer to a struct timeval. This is so ldap_ufn_timeout()
82 can be used as a cancelproc in the above functions.
83
85 See attributes(5) for a description of the following attributes:
86
87
88
89
90 ┌─────────────────────────────┬─────────────────────────────┐
91 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
92 │Availability │SUNWcsl (32-bit) │
93 │ │SUNWcslx (64-bit) │
94 │Interface Stability │Evolving │
95 └─────────────────────────────┴─────────────────────────────┘
96
98 gettimeofday(3C), ldap(3LDAP), ldap_search(3LDAP), ldap_getfil‐
99 ter(3LDAP), ldapfilter.conf(4), ldap_error(3LDAP), attributes(5)
100
102 These functions may allocates memory. Return values are contained in
103 <ldap.h>.
104
105
106
107SunOS 5.11 27 Jan 2002 ldap_ufn(3LDAP)