include/apr_ldap_url.h

00001 /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
00002  * applicable.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef APR_LDAP_URL_H
00018 #define APR_LDAP_URL_H
00019 
00020 #include "apr_ldap.h"
00021 
00022 #if APR_HAS_LDAP
00023 #if APR_HAS_LDAP_URL_PARSE
00024 
00025 #define apr_ldap_url_desc_t             LDAPURLDesc
00026 #define apr_ldap_is_ldap_url(url)       ldap_is_ldap_url(url)
00027 #define apr_ldap_is_ldaps_url(url)      ldap_is_ldaps_url(url)
00028 #define apr_ldap_is_ldapi_url(url)      ldap_is_ldapi_url(url)
00029 #define apr_ldap_url_parse(url, ludpp)  ldap_url_parse(url, ludpp)
00030 #define apr_ldap_free_urldesc(ludp)     ldap_free_urldesc(ludp)
00031 
00032 #else /* ! APR_HAS_LDAP_URL_PARSE */
00033 
00034 /*
00035  * types for ldap URL handling
00036  */
00037 typedef struct apr_ldap_url_desc_t {
00038     struct  apr_ldap_url_desc_t  *lud_next;
00039     char    *lud_scheme;
00040     char    *lud_host;
00041     int     lud_port;
00042     char    *lud_dn;
00043     char    **lud_attrs;
00044     int     lud_scope;
00045     char    *lud_filter;
00046     char    **lud_exts;
00047     int     lud_crit_exts;
00048 } apr_ldap_url_desc_t;
00049 
00050 #ifndef LDAP_URL_SUCCESS
00051 #define LDAP_URL_SUCCESS          0x00    /* Success */
00052 #define LDAP_URL_ERR_MEM          0x01    /* can't allocate memory space */
00053 #define LDAP_URL_ERR_PARAM        0x02    /* parameter is bad */
00054 #define LDAP_URL_ERR_BADSCHEME    0x03    /* URL doesn't begin with "ldap[si]://" */
00055 #define LDAP_URL_ERR_BADENCLOSURE 0x04    /* URL is missing trailing ">" */
00056 #define LDAP_URL_ERR_BADURL       0x05    /* URL is bad */
00057 #define LDAP_URL_ERR_BADHOST      0x06    /* host port is bad */
00058 #define LDAP_URL_ERR_BADATTRS     0x07    /* bad (or missing) attributes */
00059 #define LDAP_URL_ERR_BADSCOPE     0x08    /* scope string is invalid (or missing) */
00060 #define LDAP_URL_ERR_BADFILTER    0x09    /* bad or missing filter */
00061 #define LDAP_URL_ERR_BADEXTS      0x0a    /* bad or missing extensions */
00062 #endif
00063 
00064 /*
00065  * in url.c
00066  *
00067  * need _ext varients
00068  */
00069 APU_DECLARE(int) apr_ldap_is_ldap_url(const char *url);
00070 
00071 APU_DECLARE(int) apr_ldap_is_ldaps_url(const char *url);
00072 
00073 APU_DECLARE(int) apr_ldap_is_ldapi_url(const char *url);
00074 
00075 APU_DECLARE(int) apr_ldap_url_parse(const char *url, 
00076                                     apr_ldap_url_desc_t **ludpp);
00077 
00078 APU_DECLARE(void) apr_ldap_free_urldesc(apr_ldap_url_desc_t *ludp);
00079 
00080 #endif /* ! APR_HAS_LDAP_URL_PARSE */
00081 
00082 #endif /* APR_HAS_LDAP */
00083 
00084 #endif /* APR_LDAP_URL_H */

Generated on Tue Sep 11 08:13:14 2007 for Apache Portable Runtime Utility Library by  doxygen 1.5.2