upload http
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr-util / include / apr_ldap_url.h
1 /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
2  * applicable.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef APR_LDAP_URL_H
18 #define APR_LDAP_URL_H
19
20 #include "apr_ldap.h"
21
22 #if APR_HAS_LDAP
23 #if APR_HAS_LDAP_URL_PARSE
24
25 #define apr_ldap_url_desc_t             LDAPURLDesc
26 #define apr_ldap_is_ldap_url(url)       ldap_is_ldap_url(url)
27 #define apr_ldap_is_ldaps_url(url)      ldap_is_ldaps_url(url)
28 #define apr_ldap_is_ldapi_url(url)      ldap_is_ldapi_url(url)
29 #define apr_ldap_url_parse(url, ludpp)  ldap_url_parse(url, ludpp)
30 #define apr_ldap_free_urldesc(ludp)     ldap_free_urldesc(ludp)
31
32 #else /* ! APR_HAS_LDAP_URL_PARSE */
33
34 /*
35  * types for ldap URL handling
36  */
37 typedef struct apr_ldap_url_desc_t {
38     struct  apr_ldap_url_desc_t  *lud_next;
39     char    *lud_scheme;
40     char    *lud_host;
41     int     lud_port;
42     char    *lud_dn;
43     char    **lud_attrs;
44     int     lud_scope;
45     char    *lud_filter;
46     char    **lud_exts;
47     int     lud_crit_exts;
48 } apr_ldap_url_desc_t;
49
50 #ifndef LDAP_URL_SUCCESS
51 #define LDAP_URL_SUCCESS          0x00    /* Success */
52 #define LDAP_URL_ERR_MEM          0x01    /* can't allocate memory space */
53 #define LDAP_URL_ERR_PARAM        0x02    /* parameter is bad */
54 #define LDAP_URL_ERR_BADSCHEME    0x03    /* URL doesn't begin with "ldap[si]://" */
55 #define LDAP_URL_ERR_BADENCLOSURE 0x04    /* URL is missing trailing ">" */
56 #define LDAP_URL_ERR_BADURL       0x05    /* URL is bad */
57 #define LDAP_URL_ERR_BADHOST      0x06    /* host port is bad */
58 #define LDAP_URL_ERR_BADATTRS     0x07    /* bad (or missing) attributes */
59 #define LDAP_URL_ERR_BADSCOPE     0x08    /* scope string is invalid (or missing) */
60 #define LDAP_URL_ERR_BADFILTER    0x09    /* bad or missing filter */
61 #define LDAP_URL_ERR_BADEXTS      0x0a    /* bad or missing extensions */
62 #endif
63
64 /*
65  * in url.c
66  *
67  * need _ext varients
68  */
69 APU_DECLARE(int) apr_ldap_is_ldap_url(const char *url);
70
71 APU_DECLARE(int) apr_ldap_is_ldaps_url(const char *url);
72
73 APU_DECLARE(int) apr_ldap_is_ldapi_url(const char *url);
74
75 APU_DECLARE(int) apr_ldap_url_parse(const char *url, 
76                                     apr_ldap_url_desc_t **ludpp);
77
78 APU_DECLARE(void) apr_ldap_free_urldesc(apr_ldap_url_desc_t *ludp);
79
80 #endif /* ! APR_HAS_LDAP_URL_PARSE */
81
82 #endif /* APR_HAS_LDAP */
83
84 #endif /* APR_LDAP_URL_H */